Skip to content

Commit

Permalink
Generate release yaml artifact. (#702)
Browse files Browse the repository at this point in the history
Signed-off-by: Kenny Leung <kleung@chainguard.dev>
  • Loading branch information
k4leung4 authored Mar 5, 2022
1 parent 2c11841 commit ca0f097
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ before:
hooks:
- go mod tidy
- /bin/bash -c 'if [ -n "$(git --no-pager diff --exit-code go.mod go.sum)" ]; then exit 1; fi'
# if running a release we will generate the images in this step
# if running in the CI the CI env va is set by github action runner and we dont run the ko steps
# this is needed because we are generating files that goreleaser was not aware to push to GH project release
- /bin/bash -c 'if [ -z "$CI" ]; then make sign-container-release && make sign-keyless-release; fi'

gomod:
proxy: true
Expand Down Expand Up @@ -109,3 +113,6 @@ release:
name: rekor
footer: |
### Thanks for all contributors!
extra_files:
- glob: "./rekor*.yaml"
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUNTIME_IMAGE ?= gcr.io/distroless/static
# Set version variables for LDFLAGS
GIT_VERSION ?= $(shell git describe --tags --always --dirty)
GIT_HASH ?= $(shell git rev-parse HEAD)
GIT_TAG ?= dirty-tag
DATE_FMT = +'%Y-%m-%dT%H:%M:%SZ'
SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct)
ifdef SOURCE_DATE_EPOCH
Expand All @@ -44,6 +45,7 @@ endif

KO_PREFIX ?= gcr.io/projectsigstore
export KO_DOCKER_REPO=$(KO_PREFIX)
REKOR_YAML ?= rekor-$(GIT_TAG).yaml

# Binaries
SWAGGER := $(TOOLS_BIN_DIR)/swagger
Expand Down Expand Up @@ -111,13 +113,13 @@ debug:
ko:
# rekor-server
LDFLAGS="$(SERVER_LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
ko publish --base-import-paths --bare \
ko resolve --base-import-paths \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
github.com/sigstore/rekor/cmd/rekor-server
--filename config/ > $(REKOR_YAML)

# rekor-cli
LDFLAGS="$(CLI_LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
ko publish --base-import-paths --bare \
ko publish --base-import-paths \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
github.com/sigstore/rekor/cmd/rekor-cli

Expand All @@ -136,23 +138,23 @@ sign-keyless-ci: ko
.PHONY: ko-local
ko-local:
LDFLAGS="$(SERVER_LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
ko publish --base-import-paths --bare \
ko publish --base-import-paths \
--tags $(GIT_VERSION) --tags $(GIT_HASH) --local \
github.com/sigstore/rekor/cmd/rekor-server

LDFLAGS="$(CLI_LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
ko publish --base-import-paths --bare \
ko publish --base-import-paths \
--tags $(GIT_VERSION) --tags $(GIT_HASH) --local \
github.com/sigstore/rekor/cmd/rekor-cli

# This builds the trillian containers we rely on using ko for cross platform support
.PHONY: ko-trillian
ko-trillian:
LDFLAGS="$(SERVER_LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
ko publish --base-import-paths --bare \
ko publish --base-import-paths \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
github.com/google/trillian/cmd/trillian_log_signer
ko publish --base-import-paths --bare \
ko publish --base-import-paths \
--platform=all --tags $(GIT_VERSION) --tags $(GIT_HASH) \
github.com/google/trillian/cmd/trillian_log_server

Expand Down
1 change: 1 addition & 0 deletions release/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ artifacts:
paths:
- "go/src/sigstore/rekor/dist/rekor*"
- "go/src/sigstore/rekor/release/release-cosign.pub"
- "go/src/sigstore/rekor/rekor*.yaml"

options:
machineType: E2_HIGHCPU_8
Expand Down

0 comments on commit ca0f097

Please sign in to comment.