Replies: 2 comments 1 reply
-
Looks like And I found important note in docs https://werf.io/documentation/v1.2/advanced/building_images_with_stapel/artifacts.html#using-artifacts:
Meaning Resulting configVersion: 1
project: name
---
image: backend
from: gcr.io/distroless/static-debian10
import:
- artifact: backend-binary
before: setup
add: /bin/backend
---
artifact: go-deps
from: golang:1.16.6-buster
git:
- add: /go.mod
to: /project/go.mod
stageDependencies:
install:
- "*"
- add: /go.sum
to: /project/go.sum
stageDependencies:
install:
- "*"
shell:
install:
- cd /project && go mod download
---
artifact: backend-binary
from: golang:1.16.6-buster
git:
- add: /cmd/backend
to: /project/cmd/backend
stageDependencies:
setup:
- "*"
- "**/*"
- add: /go.mod
to: /project/go.mod
- add: /go.sum
to: /project/go.sum
import:
- artifact: go-deps
before: setup
add: /go
shell:
setup:
- cd /project && go build -ldflags='-s -w -extldflags "-static"' -tags netgo -trimpath -o /bin/backend ./cmd/backend |
Beta Was this translation helpful? Give feedback.
1 reply
-
I created https://github.com/develar/werf-spa-go-example. Thanks for answer. Stage dependencies now are clear for me. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a simple
werf.yaml
file.The issue — if
cmd/backend/backend.go
file is modified, I seeBut only
Building stage backend-binary/beforeSetup
is expected (rebuild app), sincego.sum
andgo.sum
are not modified.I tried to use
installCacheVersion: {{.Files.Get "go.mod" | sha256sum}}
— no luck.I tried
install: []
— no luck.So, how do I can configure werf to execute
backend-binary/beforeSetup
only if go.mod/go.sum files are changed?Beta Was this translation helpful? Give feedback.
All reactions