...

Text file src/github.com/google/go-containerregistry/cloudbuild.yaml

Documentation: github.com/google/go-containerregistry

     1timeout: 3600s  # 60 minutes
     2
     3steps:
     4- name: golang
     5  entrypoint: sh
     6  args:
     7  - -c
     8  - |
     9    set -eux
    10
    11    export GOROOT=/usr/local/go
    12    export KO_DOCKER_REPO="gcr.io/$PROJECT_ID"
    13    export GOFLAGS="-ldflags=-X=github.com/google/go-containerregistry/cmd/crane/cmd.Version=$COMMIT_SHA"
    14
    15    # Put contents of /workspace on GOPATH.
    16    shadow=$$GOPATH/src/github.com/google/go-containerregistry
    17    link_dir=$$(dirname "$$shadow")
    18    mkdir -p $$link_dir
    19    ln -s $$PWD $$shadow || stat $$shadow
    20
    21    # Install ko from release.
    22    curl -L -o ko.tar.gz https://github.com/google/ko/releases/download/v0.13.0/ko_0.13.0_Linux_i386.tar.gz
    23    tar xvfz ko.tar.gz
    24    chmod +x ko
    25    alias ko=$${PWD}/ko
    26
    27    # Use the ko binary to build the crane-ish builder images.
    28    ko build --platform=all -B github.com/google/go-containerregistry/cmd/crane  -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
    29    ko build --platform=all -B github.com/google/go-containerregistry/cmd/gcrane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
    30    # ./cmd/krane is a separate module, so switch directories.
    31    cd ./cmd/krane
    32    ko build --platform=all -B github.com/google/go-containerregistry/cmd/krane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
    33    cd ../../
    34
    35    # Use the ko binary to build the crane-ish builder *debug* images.
    36    export KO_CONFIG_PATH=$(pwd)/.ko/debug/
    37    ko build --platform=all -B github.com/google/go-containerregistry/cmd/crane  -t "debug"
    38    ko build --platform=all -B github.com/google/go-containerregistry/cmd/gcrane -t "debug"
    39    # ./cmd/krane is a separate module, so switch directories.
    40    cd ./cmd/krane
    41    ko build --platform=all -B github.com/google/go-containerregistry/cmd/krane -t "debug"
    42    cd ../../
    43
    44    # Tag-specific debug images are pushed to gcr.io/go-containerregistry/TOOL/debug:...
    45    KO_DOCKER_REPO=gcr.io/$PROJECT_ID/crane/debug  ko build --platform=all --bare github.com/google/go-containerregistry/cmd/crane  -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
    46    KO_DOCKER_REPO=gcr.io/$PROJECT_ID/gcrane/debug ko build --platform=all --bare github.com/google/go-containerregistry/cmd/gcrane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
    47    # ./cmd/krane is a separate module, so switch directories.
    48    cd ./cmd/krane
    49    KO_DOCKER_REPO=gcr.io/$PROJECT_ID/krane/debug ko build --platform=all --bare github.com/google/go-containerregistry/cmd/krane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
    50    cd ../../
    51
    52# Use the crane builder to get the digest for crane-ish.
    53- name: gcr.io/$PROJECT_ID/crane
    54  args: ['digest', 'gcr.io/$PROJECT_ID/crane']
    55
    56- name: gcr.io/$PROJECT_ID/crane
    57  args: ['digest', 'gcr.io/$PROJECT_ID/gcrane']
    58
    59- name: gcr.io/$PROJECT_ID/crane
    60  args: ['digest', 'gcr.io/$PROJECT_ID/krane']
    61

View as plain text