Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix krane build #1223

Merged
merged 1 commit into from
Dec 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
timeout: 3600s # 60 minutes

steps:
- name: golang
entrypoint: sh
Expand All @@ -7,7 +9,6 @@ steps:
set -eux

export GOROOT=/usr/local/go
export GO111MODULE=off
export KO_DOCKER_REPO="gcr.io/$PROJECT_ID"
export GOFLAGS="-ldflags=-X=github.com/google/go-containerregistry/cmd/crane/cmd.Version=$COMMIT_SHA"

Expand All @@ -21,23 +22,32 @@ steps:
curl -L -o ko.tar.gz https://github.com/google/ko/releases/download/v0.8.2/ko_0.8.2_Linux_i386.tar.gz
tar xvfz ko.tar.gz
chmod +x ko
alias ko=./ko
alias ko=$${PWD}/ko

# Use the ko binary to build the crane-ish builder images.
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/crane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/gcrane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
# ./cmd/krane is a separate module, so switch directories.
cd ./cmd/krane
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/krane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
cd ../../

# Use the ko binary to build the crane-ish builder *debug* images.
export KO_CONFIG_PATH=./.ko/debug/
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/crane -t "debug"
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/gcrane -t "debug"
# ./cmd/krane is a separate module, so switch directories.
cd ./cmd/krane
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/krane -t "debug"
cd ../../

# Tag-specific debug images are pushed to gcr.io/go-containerregistry/TOOL/debug:...
KO_DOCKER_REPO=gcr.io/$PROJECT_ID/crane/debug ko publish --platform=all --bare github.com/google/go-containerregistry/cmd/crane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
KO_DOCKER_REPO=gcr.io/$PROJECT_ID/gcrane/debug ko publish --platform=all --bare github.com/google/go-containerregistry/cmd/gcrane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
# ./cmd/krane is a separate module, so switch directories.
cd ./cmd/krane
KO_DOCKER_REPO=gcr.io/$PROJECT_ID/krane/debug ko publish --platform=all --bare github.com/google/go-containerregistry/cmd/krane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
cd ../../

# Use the crane builder to get the digest for crane-ish.
- name: gcr.io/$PROJECT_ID/crane
Expand Down