Skip to content

Commit

Permalink
Add ko targets for the webhook image. (#630)
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Lorenc <dlorenc@google.com>
  • Loading branch information
dlorenc authored Sep 7, 2021
1 parent 53fbe01 commit cb0c46a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
- name: creds
run: gcloud auth configure-docker --quiet
- name: container
run: echo -n "${{secrets.COSIGN_PASSWORD}}" | KO_DOCKER_REPO=gcr.io/projectsigstore/cosign/ci/cosign make sign-container
run: echo -n "${{secrets.COSIGN_PASSWORD}}" | KO_PREFIX=gcr.io/projectsigstore/cosign/ci make sign-container
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,26 @@ clean:
.PHONY: ko
ko:
# We can't pass more than one LDFLAG via GOFLAGS, you can't have spaces in there.
CGO_ENABLED=0 GOFLAGS="-ldflags=-X=$(PKG).gitCommit=$(GIT_HASH)" ko publish --bare \
KO_DOCKER_REPO=${KO_PREFIX}/cosign CGO_ENABLED=0 GOFLAGS="-ldflags=-X=$(PKG).gitCommit=$(GIT_HASH)" ko publish --bare \
--tags $(GIT_VERSION) --tags $(GIT_HASH) \
github.com/sigstore/cosign/cmd/cosign

# cosigned
KO_DOCKER_REPO=${KO_PREFIX}/cosigned CGO_ENABLED=0 GOFLAGS="-ldflags=-X=$(PKG).gitCommit=$(GIT_HASH)" ko publish --bare \
--tags $(GIT_VERSION) --tags $(GIT_HASH) \
github.com/sigstore/cosign/cmd/cosign/webhook

.PHONY: ko-local
ko-local:
# We can't pass more than one LDFLAG via GOFLAGS, you can't have spaces in there.
CGO_ENABLED=0 GOFLAGS="-ldflags=-X=$(PKG).gitCommit=$(GIT_HASH)" ko publish --bare \
KO_DOCKER_REPO=${KO_PREFIX}/cosign CGO_ENABLED=0 GOFLAGS="-ldflags=-X=$(PKG).gitCommit=$(GIT_HASH)" ko publish --bare \
--tags $(GIT_VERSION) --tags $(GIT_HASH) --local \
github.com/sigstore/cosign/cmd/cosign

.PHONY: sign-container
sign-container: ko
cosign sign -key .github/workflows/cosign.key -a GIT_HASH=$(GIT_HASH) ${KO_DOCKER_REPO}:$(GIT_HASH)
cosign sign -key .github/workflows/cosign.key -a GIT_HASH=$(GIT_HASH) ${KO_PREFIX}/cosign:$(GIT_HASH)
cosign sign -key .github/workflows/cosign.key -a GIT_HASH=$(GIT_HASH) ${KO_PREFIX}/cosigned:$(GIT_HASH)

# used when releasing together with GCP CloudBuild
.PHONY: release
Expand Down

0 comments on commit cb0c46a

Please sign in to comment.