circleci: VersionPrerelease: show tag or branch name and hash when building binary (#8850)
VersionPrerelease=${CIRCLE_TAG:=${CIRCLE_BRANCH}}-${CIRCLE_SHA1:0:9}"
This commit is contained in:
parent
764b4cb50a
commit
9e6c94e141
|
@ -36,7 +36,7 @@ commands:
|
||||||
type: string
|
type: string
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: GOOS=<< parameters.GOOS >> go build -ldflags="-s -w" -o ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH) .
|
- run: GOOS=<< parameters.GOOS >> go build -ldflags="-s -w -X github.com/hashicorp/packer/version.GitCommit=${CIRCLE_SHA1}" -o ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH) .
|
||||||
- run: zip ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH).zip ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH)
|
- run: zip ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH).zip ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH)
|
||||||
- run: rm ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH)
|
- run: rm ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH)
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
|
|
Loading…
Reference in New Issue