Skip to content

Commit 5b07fac

Browse files
committed
Add build and release for csi proxy to gcs bucket
This PR adds building and publishing csi-proxy binary to gcs bucket k8s-artifacts-csi
1 parent 9eff164 commit 5b07fac

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.cloudbuild.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#! /bin/bash
2+
3+
. release-tools/prow.sh
4+
5+
# Extract tag-n-hash value from GIT_TAG (form vYYYYMMDD-tag-n-hash) for REV value.
6+
REV=v$(echo $GIT_TAG | cut -f3- -d 'v')
7+
8+
run_with_go "${CSI_PROW_GO_VERSION_BUILD}" make build REV=${REV}
9+
cp bin/csi-proxy.exe bin/csi-proxy-${PULL_BASE_REF}.exe

cloudbuild.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# See https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md for more details on image pushing process
2+
3+
# this must be specified in seconds. If omitted, defaults to 600s (10 mins)
4+
timeout: 1200s
5+
# this prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF,
6+
# or any new substitutions added in the future.
7+
options:
8+
substitution_option: ALLOW_LOOSE
9+
steps:
10+
# The image must contain bash and curl. Ideally it should also contain
11+
# the desired version of Go (currently defined in release-tools/travis.yml),
12+
# but that just speeds up the build and is not required.
13+
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200421-a2bf5f8'
14+
entrypoint: bash
15+
env:
16+
- GIT_TAG=${_GIT_TAG}
17+
- PULL_BASE_REF=${_PULL_BASE_REF}
18+
- HOME=/root
19+
args:
20+
- .cloudbuild.sh
21+
substitutions:
22+
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
23+
# can be used as a substitution
24+
_GIT_TAG: '12345'
25+
# _PULL_BASE_REF will contain the ref that was pushed to trigger this build -
26+
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
27+
_PULL_BASE_REF: 'master'
28+
artifacts:
29+
objects:
30+
location: 'gs://k8s-artifacts-csi/dev'
31+
paths: 'bin/csi-proxy-${_PULL_BASE_REF}.exe'
32+

0 commit comments

Comments
 (0)