buildpacks icon indicating copy to clipboard operation
buildpacks copied to clipboard

Golang workspace

Open t0mpl opened this issue 3 years ago • 1 comments

Hi everyone,

Trying to get my head around building a module in sub-folder of a workspace and I can't figure out if I'm doing something wrong or if this feature doesn't exist yet. I've seen that there is the env variable GOWORK, which should be automatically set but even when i manually set it I still have the problem. Here is my skaffold config:

build:
  artifacts:
  - image: apis/grpc
    context: ../testproject/apis/grpc
    buildpacks:
      builder: "gcr.io/buildpacks/builder:v1"
    hooks:
      before:
        - command: ["make", "-C", "../testproject/apis/grpc", "pre-build"]
          os: [darwin, linux, windows]
      after:
        - command: ["make", "-C", "../testproject/apis/grpc", "post-build"]
          os: [darwin, linux, windows]

pre-build is vendoring, post-build is removing vendor folder

Is there a way to achieve that, should I wait or should I find another solution?

Thanks for your help

t0mpl avatar Jun 29 '22 07:06 t0mpl

for those who will visit the issue have the same problem, I found a solution on skaffold with ko

build:
  artifacts:
  - image: apis/grpc
    context: ../testproject
    ko: 
      dir: ./apis/grpc

this is not using this builder solution though

t0mpl avatar Jul 03 '22 10:07 t0mpl