1
0
Fork 0

add sops binary target

This commit is contained in:
Lance Vick 2023-05-05 12:09:21 -07:00
parent 6ed53333da
commit 1a9e368399
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
3 changed files with 20 additions and 1 deletions

View File

@ -89,6 +89,9 @@ $(CACHE_DIR)/secrets:
$(FETCH_DIR)/terraform: $(FETCH_DIR)/terraform:
$(call git_clone,$@,$(TERRAFORM_REPO),$(TERRAFORM_REF)) $(call git_clone,$@,$(TERRAFORM_REPO),$(TERRAFORM_REF))
$(FETCH_DIR)/sops:
$(call git_clone,$@,$(SOPS_REPO),$(SOPS_REF))
$(OUT_DIR)/terraform: $(FETCH_DIR)/terraform $(OUT_DIR)/terraform: $(FETCH_DIR)/terraform
$(call toolchain," \ $(call toolchain," \
cd $(FETCH_DIR)/terraform && \ cd $(FETCH_DIR)/terraform && \
@ -102,3 +105,18 @@ $(OUT_DIR)/terraform: $(FETCH_DIR)/terraform
-ldflags='-w -extldflags=-static' \ -ldflags='-w -extldflags=-static' \
-o /home/build/$@ \ -o /home/build/$@ \
") ")
$(OUT_DIR)/sops: $(FETCH_DIR)/sops
$(call toolchain," \
cd $(FETCH_DIR)/sops && \
export SSL_CERT_DIR=/etc/ssl/certs && \
export GOCACHE=/home/build/$(CACHE_DIR) && \
export GOPATH=/home/build/$(CACHE_DIR) && \
export CGO_ENABLED=0 && \
go build \
-v \
-trimpath \
-ldflags='-w -extldflags=-static' \
-o /home/build/$@ \
go.mozilla.org/sops/v3/cmd/sops \
")

View File

@ -10,6 +10,5 @@ For the purpose of transparency, we include our infrastructure configuration rig
## Usage ## Usage
```shell ```shell
$ sops exec-env secrets/production.enc.env $(getent passwd $UID | cut -d: -f7)
$ make $ make
``` ```

View File

@ -1,3 +1,5 @@
DEBIAN_HASH=f9e970d357981f7f5055f89365af980534ce742fc11480c51f929da83aa15980 DEBIAN_HASH=f9e970d357981f7f5055f89365af980534ce742fc11480c51f929da83aa15980
TERRAFORM_REF=db6079cfe269803701be9e1a89aeaf9a93714e86 TERRAFORM_REF=db6079cfe269803701be9e1a89aeaf9a93714e86
TERRAFORM_REPO=https://github.com/hashicorp/terraform TERRAFORM_REPO=https://github.com/hashicorp/terraform
SOPS_REF=e1edc059487ddd14236dfe47267b05052f6c20b4
SOPS_REPO=https://github.com/mozilla/sops