forked from getsops/sops
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make version a var and add arr_build.sh
By change Version from and const to a var we are able to use ldflags to set the version dynamically. In the arr_build.sh file for example, we can set it with: -ldflags="-X go.mozilla.org/sops/v3/version.Version=$VERSION" arr_build.sh will buld the sops binary in the repo root and will print the instructions for releasing it to gcs.
- Loading branch information
Karl Schriek
committed
Mar 8, 2022
1 parent
68e2a82
commit 96daa0b
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
VERSION=$(git describe) | ||
VERSION="${VERSION:1}" # change example v3.7.1 to 3.7.1 | ||
go build -o sops -ldflags="-X go.mozilla.org/sops/v3/version.Version=$VERSION" ./cmd/sops | ||
|
||
echo "Successfully built with version: $(./sops --version)" | ||
|
||
BUCKET=arrikto | ||
OBJECT=sops/sops-${VERSION} | ||
GSURL=gs://${BUCKET}/${OBJECT} | ||
URL=https://storage.googleapis.com/${BUCKET}/${OBJECT} | ||
|
||
echo To upload to GCS run: | ||
echo " gsutil cp ./sops ${GSURL}" | ||
|
||
echo To make it public run: | ||
echo " gsutil acl ch -u AllUsers:R ${GSURL}" | ||
|
||
echo To verify that it is publicly accessible run: | ||
echo " curl -I ${URL}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters