Skip to content

Commit

Permalink
Add a ko-built docker image to the makefile. (#133)
Browse files Browse the repository at this point in the history
This still doesn't build as part of our release process, we need to hook up GCP creds
somewhere.

Signed-off-by: Dan Lorenc <dlorenc@google.com>
  • Loading branch information
dlorenc authored Mar 21, 2021
1 parent 0920f49 commit 8974bdc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
echo -n "${{secrets.COSIGN_PASSWORD}}" | ./cosign-linux-amd64 sign-blob -key ./.github/workflows/cosign.key ././cosign-linux-amd64 > cosign-linux-amd64.sig
echo -n "${{secrets.COSIGN_PASSWORD}}" | ./cosign-linux-amd64 sign-blob -key ./.github/workflows/cosign.key ././cosign-darwin-amd64 > cosign-darwin-amd64.sig
- name: verify
run: ./cosign verify-blob -key ./.github/workflows/cosign.pub -signature cosign.sig ./cosign
run: ./cosign verify-blob -key ./.github/workflows/cosign.pub -signature cosign.sig ./cosign-linux-amd64
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .ko.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# We need a shell for a lot of redirection/piping to work
defaultBaseImage: gcr.io/distroless/base:debug
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ ifeq ($(DIFF), 1)
GIT_TREESTATE = "dirty"
endif

LDFLAGS = "-X github.com/sigstore/cosign/cmd/cosign/cli.gitVersion=$(GIT_VERSION) \
-X github.com/sigstore/cosign/cmd/cosign/cli.gitCommit=$(GIT_HASH) \
-X github.com/sigstore/cosign/cmd/cosign/cli.gitTreeState=$(GIT_TREESTATE) \
-X github.com/sigstore/cosign/cmd/cosign/cli.buildDate=$(BUILDDATE)"
PKG=github.com/sigstore/cosign/cmd/cosign/cli

LDFLAGS="-X $(PKG).gitVersion=$(GIT_VERSION) -X $(PKG).gitCommit=$(GIT_HASH) -X $(PKG).gitTreeState=$(GIT_TREESTATE)"

.PHONY: all lint test clean cosign cross

Expand Down Expand Up @@ -54,3 +53,7 @@ test:
clean:
rm -rf cosign

.PHONY: ko
ko:
# We can't pass more than one LDFLAG via GOFLAGS, you can't have spaces in there.
GOFLAGS="-ldflags=-X=$(PKG).gitCommit=$(GIT_HASH)" ko publish github.com/sigstore/cosign/cmd/cosign

0 comments on commit 8974bdc

Please sign in to comment.