Skip to content

Commit

Permalink
Merge pull request #53 from jingxu97/May/build
Browse files Browse the repository at this point in the history
Add build and release for csi proxy to gcs bucket
  • Loading branch information
k8s-ci-robot authored Jun 30, 2020
2 parents 9eff164 + 9dab535 commit f72dab1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .cloudbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/bash

. release-tools/prow.sh

# Extract tag-n-hash value from GIT_TAG (form vYYYYMMDD-tag-n-hash) for REV value.
REV=v$(echo $GIT_TAG | cut -f3- -d 'v')

run_with_go "${CSI_PROW_GO_VERSION_BUILD}" make build REV=${REV}
cp bin/csi-proxy.exe bin/csi-proxy-${PULL_BASE_REF}.exe
32 changes: 32 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# See https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md for more details on image pushing process

# this must be specified in seconds. If omitted, defaults to 600s (10 mins)
timeout: 1200s
# this prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF,
# or any new substitutions added in the future.
options:
substitution_option: ALLOW_LOOSE
steps:
# The image must contain bash and curl. Ideally it should also contain
# the desired version of Go (currently defined in release-tools/travis.yml),
# but that just speeds up the build and is not required.
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200421-a2bf5f8'
entrypoint: bash
env:
- GIT_TAG=${_GIT_TAG}
- PULL_BASE_REF=${_PULL_BASE_REF}
- HOME=/root
args:
- .cloudbuild.sh
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: '12345'
# _PULL_BASE_REF will contain the ref that was pushed to trigger this build -
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
_PULL_BASE_REF: 'master'
artifacts:
objects:
location: 'gs://k8s-artifacts-csi/csi-proxy/dev'
paths: 'bin/csi-proxy-${_PULL_BASE_REF}.exe'

0 comments on commit f72dab1

Please sign in to comment.