Skip to content

Commit 95da8b4

Browse files
committed
Squashed 'release-tools/' changes from 152396e..a0f195c
a0f195c Merge pull request #106 from msau42/fix-canary 7100c12 Only set staging registry when running canary job b3c65f9 Merge pull request #99 from msau42/add-release-process e53f3e8 Merge pull request #103 from msau42/fix-canary d129462 Document new method for adding CI jobs are new K8s versions e73c2ce Use staging registry for canary tests 2c09846 Add cleanup instructions to release-notes generation 60e1cd3 Merge pull request #98 from pohly/kubernetes-1-19-fixes 0979c09 prow.sh: fix E2E suite for Kubernetes >= 1.18 3b4a2f1 prow.sh: fix installing Go for Kubernetes 1.19.0 1fbb636 Merge pull request #97 from pohly/go-1.15 82d108a switch to Go 1.15 d8a2530 Merge pull request #95 from msau42/add-release-process 843bddc Add steps on promoting release images 0345a83 Merge pull request #94 from linux-on-ibm-z/bump-timeout 1fdf2d5 cloud build: bump timeout in Prow job 41ec6d1 Merge pull request #93 from animeshk08/patch-1 5a54e67 filter-junit: Fix gofmt error 0676fcb Merge pull request #92 from animeshk08/patch-1 36ea4ff filter-junit: Fix golint error f5a4203 Merge pull request #91 from cyb70289/arm64 43e50d6 prow.sh: enable building arm64 image 0d5bd84 Merge pull request #90 from pohly/k8s-staging-sig-storage 3df86b7 cloud build: k8s-staging-sig-storage c5fd961 Merge pull request #89 from pohly/cloud-build-binfmt db0c2a7 cloud build: initialize support for running commands in Dockerfile be902f4 Merge pull request #88 from pohly/multiarch-windows-fix 340e082 build.make: optional inclusion of Windows in multiarch images 5231f05 build.make: properly declare push-multiarch 4569f27 build.make: fix push-multiarch ambiguity 17dde9e Merge pull request #87 from pohly/cloud-build bd41690 cloud build: initial set of shared files 9084fec Merge pull request #81 from msau42/add-release-process 6f2322e Update patch release notes generation command 0fcc3b1 Merge pull request #78 from ggriffiths/fix_csi_snapshotter_rbac_version_set d8c76fe Support local snapshot RBAC for pull jobs c1bdf5b Merge pull request #80 from msau42/add-release-process ea1f94a update release tools instructions git-subtree-dir: release-tools git-subtree-split: a0f195cc2ddc2a1f07d4d3e46fc08187db358f94
1 parent 152396e commit 95da8b4

7 files changed

+220
-42
lines changed

SIDECAR_RELEASE_PROCESS.md

+28-12
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,39 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
3939
1. Changes can then be updated in all the sidecar repos and hostpath driver repo
4040
by following the [update
4141
instructions](https://github.com/kubernetes-csi/csi-release-tools/blob/master/README.md#sharing-and-updating).
42-
1. New pull and CI jobs are configured by
42+
1. New pull and CI jobs are configured by adding new K8s versions to the top of
4343
[gen-jobs.sh](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-csi/gen-jobs.sh).
44-
New pull jobs that have been unverified should be initially made optional.
45-
[Example](https://github.com/kubernetes/test-infra/pull/15055)
44+
New pull jobs that have been unverified should be initially made optional by
45+
setting the new K8s version as
46+
[experimental](https://github.com/kubernetes/test-infra/blob/a1858f46d6014480b130789df58b230a49203a64/config/jobs/kubernetes-csi/gen-jobs.sh#L40).
4647
1. Once new pull and CI jobs have been verified, and the new Kubernetes version
4748
is released, we can make the optional jobs required, and also remove the
4849
Kubernetes versions that are no longer supported.
4950

5051
## Release Process
5152
1. Identify all issues and ongoing PRs that should go into the release, and
5253
drive them to resolution.
53-
1. Download [K8s release notes
54+
1. Download v2.8+ [K8s release notes
5455
generator](https://github.com/kubernetes/release/tree/master/cmd/release-notes)
5556
1. Generate release notes for the release. Replace arguments with the relevant
5657
information.
57-
```
58-
GITHUB_TOKEN=<token> ./release-notes --start-sha=0ed6978fd199e3ca10326b82b4b8b8e916211c9b --end-sha=3cb3d2f18ed8cb40371c6d8886edcabd1f27e7b9 \
59-
--github-org=kubernetes-csi --github-repo=external-attacher -branch=master -output out.md
60-
```
61-
* `--start-sha` should point to the last release from the same branch. For
62-
example:
63-
* `1.X-1.0` tag when releasing `1.X.0`
64-
* `1.X.Y-1` tag when releasing `1.X.Y`
58+
* Clean up old cached information (also needed if you are generating release
59+
notes for multiple repos)
60+
```bash
61+
rm -rf /tmp/k8s-repo
62+
```
63+
* For new minor releases on master:
64+
```bash
65+
GITHUB_TOKEN=<token> release-notes --discover=mergebase-to-latest
66+
--github-org=kubernetes-csi --github-repo=external-provisioner
67+
--required-author="" --output out.md
68+
```
69+
* For new patch releases on a release branch:
70+
```bash
71+
GITHUB_TOKEN=<token> release-notes --discover=patch-to-latest --branch=release-1.1
72+
--github-org=kubernetes-csi --github-repo=external-provisioner
73+
--required-author="" --output out.md
74+
```
6575
1. Compare the generated output to the new commits for the release to check if
6676
any notable change missed a release note.
6777
1. Reword release notes as needed. Make sure to check notes for breaking
@@ -82,6 +92,12 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
8292
[external-provisioner example](https://github.com/kubernetes-csi/external-provisioner/releases/new)
8393
1. If release was a new major/minor version, create a new `release-<minor>`
8494
branch at that commit.
95+
1. Check [image build status](https://k8s-testgrid.appspot.com/sig-storage-image-build).
96+
1. Promote images from k8s-staging-sig-storage to k8s.gcr.io/sig-storage. From
97+
the [k8s image
98+
repo](https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io/images/k8s-staging-sig-storage),
99+
run `./generate.sh > images.yaml`, and send a PR with the updated images.
100+
Once merged, the image promoter will copy the images from staging to prod.
85101
1. Update [kubernetes-csi/docs](https://github.com/kubernetes-csi/docs) sidecar
86102
and feature pages with the new released version.
87103
1. After all the sidecars have been released, update

build.make

+74-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ BUILD_PLATFORMS =
7171

7272
# This builds each command (= the sub-directories of ./cmd) for the target platform(s)
7373
# defined by BUILD_PLATFORMS.
74-
build-%: check-go-version-go
74+
$(CMDS:%=build-%): build-%: check-go-version-go
7575
mkdir -p bin
7676
echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch suffix; do \
7777
if ! (set -x; CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o "./bin/$*$$suffix" ./cmd/$*); then \
@@ -80,10 +80,10 @@ build-%: check-go-version-go
8080
fi; \
8181
done
8282

83-
container-%: build-%
83+
$(CMDS:%=container-%): container-%: build-%
8484
docker build -t $*:latest -f $(shell if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi) --label revision=$(REV) .
8585

86-
push-%: container-%
86+
$(CMDS:%=push-%): push-%: container-%
8787
set -ex; \
8888
push_image () { \
8989
docker tag $*:latest $(IMAGE_NAME):$$tag; \
@@ -105,6 +105,77 @@ build: $(CMDS:%=build-%)
105105
container: $(CMDS:%=container-%)
106106
push: $(CMDS:%=push-%)
107107

108+
# Additional parameters are needed when pushing to a local registry,
109+
# see https://github.com/docker/buildx/issues/94.
110+
# However, that then runs into https://github.com/docker/cli/issues/2396.
111+
#
112+
# What works for local testing is:
113+
# make push-multiarch PULL_BASE_REF=master REGISTRY_NAME=<your account on dockerhub.io> BUILD_PLATFORMS="linux amd64; windows amd64 .exe; linux ppc64le -ppc64le; linux s390x -s390x"
114+
DOCKER_BUILDX_CREATE_ARGS ?=
115+
116+
# This target builds a multiarch image for one command using Moby BuildKit builder toolkit.
117+
# Docker Buildx is included in Docker 19.03.
118+
#
119+
# ./cmd/<command>/Dockerfile[.Windows] is used if found, otherwise Dockerfile[.Windows].
120+
# It is currently optional: if no such file exists, Windows images are not included,
121+
# even when Windows is listed in BUILD_PLATFORMS. That way, projects can test that
122+
# Windows binaries can be built before adding a Dockerfile for it.
123+
#
124+
# BUILD_PLATFORMS determines which individual images are included in the multiarch image.
125+
# PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name, and determines
126+
# the tag for the resulting multiarch image.
127+
$(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
128+
set -ex; \
129+
DOCKER_CLI_EXPERIMENTAL=enabled; \
130+
export DOCKER_CLI_EXPERIMENTAL; \
131+
docker buildx create $(DOCKER_BUILDX_CREATE_ARGS) --use --name multiarchimage-buildertest; \
132+
trap "docker buildx rm multiarchimage-buildertest" EXIT; \
133+
dockerfile_linux=$$(if [ -e ./cmd/$*/Dockerfile ]; then echo ./cmd/$*/Dockerfile; else echo Dockerfile; fi); \
134+
dockerfile_windows=$$(if [ -e ./cmd/$*/Dockerfile.Windows ]; then echo ./cmd/$*/Dockerfile.Windows; else echo Dockerfile.Windows; fi); \
135+
if [ '$(BUILD_PLATFORMS)' ]; then build_platforms='$(BUILD_PLATFORMS)'; else build_platforms="linux amd64"; fi; \
136+
if ! [ -f "$$dockerfile_windows" ]; then \
137+
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *.exe//g' -e 's/; *;/;/g')"; \
138+
fi; \
139+
pushMultiArch () { \
140+
tag=$$1; \
141+
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix; do \
142+
docker buildx build --push \
143+
--tag $(IMAGE_NAME):$$arch-$$os-$$tag \
144+
--platform=$$os/$$arch \
145+
--file $$(eval echo \$${dockerfile_$$os}) \
146+
--build-arg binary=./bin/$*$$suffix \
147+
--label revision=$(REV) \
148+
.; \
149+
done; \
150+
images=$$(echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix; do echo $(IMAGE_NAME):$$arch-$$os-$$tag; done); \
151+
docker manifest create --amend $(IMAGE_NAME):$$tag $$images; \
152+
docker manifest push -p $(IMAGE_NAME):$$tag; \
153+
}; \
154+
if [ $(PULL_BASE_REF) = "master" ]; then \
155+
: "creating or overwriting canary image"; \
156+
pushMultiArch canary; \
157+
elif echo $(PULL_BASE_REF) | grep -q -e 'release-*' ; then \
158+
: "creating or overwriting canary image for release branch"; \
159+
release_canary_tag=$$(echo $(PULL_BASE_REF) | cut -f2 -d '-')-canary; \
160+
pushMultiArch $$release_canary_tag; \
161+
elif docker pull $(IMAGE_NAME):$(PULL_BASE_REF) 2>&1 | tee /dev/stderr | grep -q "manifest for $(IMAGE_NAME):$(PULL_BASE_REF) not found"; then \
162+
: "creating release image"; \
163+
pushMultiArch $(PULL_BASE_REF); \
164+
else \
165+
: "ERROR: release image $(IMAGE_NAME):$(PULL_BASE_REF) already exists: a new tag is required!"; \
166+
exit 1; \
167+
fi
168+
169+
.PHONY: check-pull-base-ref
170+
check-pull-base-ref:
171+
if ! [ "$(PULL_BASE_REF)" ]; then \
172+
echo >&2 "ERROR: PULL_BASE_REF must be set to 'master', 'release-x.y', or a tag name."; \
173+
exit 1; \
174+
fi
175+
176+
.PHONY: push-multiarch
177+
push-multiarch: $(CMDS:%=push-multiarch-%)
178+
108179
clean:
109180
-rm -rf bin
110181

cloudbuild.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /bin/bash
2+
3+
# shellcheck disable=SC1091
4+
. release-tools/prow.sh
5+
6+
gcr_cloud_build

cloudbuild.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# A configuration file for multi-arch image building with the Google cloud build service.
2+
#
3+
# Repos using this file must:
4+
# - import csi-release-tools
5+
# - add a symlink cloudbuild.yaml -> release-tools/cloudbuild.yaml
6+
# - add a .cloudbuild.sh which can be a custom file or a symlink
7+
# to release-tools/cloudbuild.sh
8+
# - accept "binary" as build argument in their Dockerfile(s) (see
9+
# https://github.com/pohly/node-driver-registrar/blob/3018101987b0bb6da2a2657de607174d6e3728f7/Dockerfile#L4-L6)
10+
# because binaries will get built for different architectures and then
11+
# get copied from the built host into the container image
12+
#
13+
# See https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md
14+
# for more details on image pushing process in Kubernetes.
15+
#
16+
# To promote release images, see https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io/images/k8s-staging-sig-storage.
17+
18+
# This must be specified in seconds. If omitted, defaults to 600s (10 mins).
19+
timeout: 1800s
20+
# This prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF,
21+
# or any new substitutions added in the future.
22+
options:
23+
substitution_option: ALLOW_LOOSE
24+
steps:
25+
# The image must contain bash and curl. Ideally it should also contain
26+
# the desired version of Go (currently defined in release-tools/travis.yml),
27+
# but that just speeds up the build and is not required.
28+
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200421-a2bf5f8'
29+
entrypoint: ./.cloudbuild.sh
30+
env:
31+
- GIT_TAG=${_GIT_TAG}
32+
- PULL_BASE_REF=${_PULL_BASE_REF}
33+
- REGISTRY_NAME=gcr.io/${_STAGING_PROJECT}
34+
- HOME=/root
35+
substitutions:
36+
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
37+
# can be used as a substitution.
38+
_GIT_TAG: '12345'
39+
# _PULL_BASE_REF will contain the ref that was pushed to trigger this build -
40+
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
41+
_PULL_BASE_REF: 'master'
42+
# The default gcr.io staging project for Kubernetes-CSI
43+
# (=> https://console.cloud.google.com/gcr/images/k8s-staging-sig-storage/GLOBAL).
44+
# Might be overridden in the Prow build job for a repo which wants
45+
# images elsewhere.
46+
_STAGING_PROJECT: 'k8s-staging-sig-storage'

filter-junit.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ limitations under the License.
1515
*/
1616

1717
/*
18-
* This command filters a JUnit file such that only tests with a name
19-
* matching a regular expression are passed through. By concatenating
20-
* multiple input files it is possible to merge them into a single file.
21-
*/
18+
This command filters a JUnit file such that only tests with a name
19+
matching a regular expression are passed through. By concatenating
20+
multiple input files it is possible to merge them into a single file.
21+
*/
2222
package main
2323

2424
import (

prow.sh

+61-22
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ get_versioned_variable () {
8585
echo "$value"
8686
}
8787

88-
configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; windows amd64 .exe; linux ppc64le -ppc64le; linux s390x -s390x" "Go target platforms (= GOOS + GOARCH) and file suffix of the resulting binaries"
88+
configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; windows amd64 .exe; linux ppc64le -ppc64le; linux s390x -s390x; linux arm64 -arm64" "Go target platforms (= GOOS + GOARCH) and file suffix of the resulting binaries"
8989

9090
# If we have a vendor directory, then use it. We must be careful to only
9191
# use this for "make" invocations inside the project's repo itself because
@@ -211,24 +211,29 @@ configvar CSI_PROW_DRIVER_INSTALL "install_csi_driver" "name of the shell functi
211211
# still use that name.
212212
configvar CSI_PROW_DRIVER_CANARY "${CSI_PROW_HOSTPATH_CANARY}" "driver image override for canary images"
213213

214+
# Image registry to use for canary images.
215+
# Only valid if CSI_PROW_DRIVER_CANARY == "canary".
216+
configvar CSI_PROW_DRIVER_CANARY_REGISTRY "gcr.io/k8s-staging-sig-storage" "registry for canary images"
217+
214218
# The E2E testing can come from an arbitrary repo. The expectation is that
215219
# the repo supports "go test ./test/e2e -args --storage.testdriver" (https://github.com/kubernetes/kubernetes/pull/72836)
216220
# after setting KUBECONFIG. As a special case, if the repository is Kubernetes,
217221
# then `make WHAT=test/e2e/e2e.test` is called first to ensure that
218222
# all generated files are present.
219223
#
220224
# CSI_PROW_E2E_REPO=none disables E2E testing.
221-
# TOOO: remove versioned variables and make e2e version match k8s version
222-
configvar CSI_PROW_E2E_VERSION_1_15 v1.15.0 "E2E version for Kubernetes 1.15.x"
223-
configvar CSI_PROW_E2E_VERSION_1_16 v1.16.0 "E2E version for Kubernetes 1.16.x"
224-
configvar CSI_PROW_E2E_VERSION_1_17 v1.17.0 "E2E version for Kubernetes 1.17.x"
225-
# TODO: add new CSI_PROW_E2E_VERSION entry for future Kubernetes releases
226-
configvar CSI_PROW_E2E_VERSION_LATEST master "E2E version for Kubernetes master" # testing against Kubernetes master is already tracking a moving target, so we might as well use a moving E2E version
227-
configvar CSI_PROW_E2E_REPO_LATEST https://github.com/kubernetes/kubernetes "E2E repo for Kubernetes >= 1.13.x" # currently the same for all versions
228-
configvar CSI_PROW_E2E_IMPORT_PATH_LATEST k8s.io/kubernetes "E2E package for Kubernetes >= 1.13.x" # currently the same for all versions
229-
configvar CSI_PROW_E2E_VERSION "$(get_versioned_variable CSI_PROW_E2E_VERSION "${csi_prow_kubernetes_version_suffix}")" "E2E version"
230-
configvar CSI_PROW_E2E_REPO "$(get_versioned_variable CSI_PROW_E2E_REPO "${csi_prow_kubernetes_version_suffix}")" "E2E repo"
231-
configvar CSI_PROW_E2E_IMPORT_PATH "$(get_versioned_variable CSI_PROW_E2E_IMPORT_PATH "${csi_prow_kubernetes_version_suffix}")" "E2E package"
225+
tag_from_version () {
226+
version="$1"
227+
shift
228+
case "$version" in
229+
latest) echo "master";;
230+
release-*) echo "$version";;
231+
*) echo "v$version";;
232+
esac
233+
}
234+
configvar CSI_PROW_E2E_VERSION "$(tag_from_version "${CSI_PROW_KUBERNETES_VERSION}")" "E2E version"
235+
configvar CSI_PROW_E2E_REPO "https://github.com/kubernetes/kubernetes" "E2E repo"
236+
configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package"
232237

233238
# csi-sanity testing from the csi-test repo can be run against the installed
234239
# CSI driver. For this to work, deploying the driver must expose the Unix domain
@@ -513,6 +518,10 @@ go_version_for_kubernetes () (
513518
if ! [ "$go_version" ]; then
514519
die "Unable to determine Go version for Kubernetes $version from hack/lib/golang.sh."
515520
fi
521+
# Strip the trailing .0. Kubernetes includes it, Go itself doesn't.
522+
# Ignore: See if you can use ${variable//search/replace} instead.
523+
# shellcheck disable=SC2001
524+
go_version="$(echo "$go_version" | sed -e 's/\.0$//')"
516525
echo "$go_version"
517526
)
518527

@@ -688,7 +697,11 @@ install_csi_driver () {
688697
fi
689698

690699
if [ "${CSI_PROW_DRIVER_CANARY}" != "stable" ]; then
700+
if [ "${CSI_PROW_DRIVER_CANARY}" == "canary" ]; then
701+
images="$images IMAGE_TAG=${CSI_PROW_DRIVER_CANARY} IMAGE_REGISTRY=${CSI_PROW_DRIVER_CANARY_REGISTRY}"
702+
else
691703
images="$images IMAGE_TAG=${CSI_PROW_DRIVER_CANARY}"
704+
fi
692705
fi
693706
# Ignore: Double quote to prevent globbing and word splitting.
694707
# It's intentional here for $images.
@@ -1064,18 +1077,24 @@ main () {
10641077
# always pulling the image
10651078
# (https://github.com/kubernetes-sigs/kind/issues/328).
10661079
docker tag "$i:latest" "$i:csiprow" || die "tagging the locally built container image for $i failed"
1067-
done
10681080

1069-
if [ -e deploy/kubernetes/rbac.yaml ]; then
1070-
# This is one of those components which has its own RBAC rules (like external-provisioner).
1071-
# We are testing a locally built image and also want to test with the the current,
1072-
# potentially modified RBAC rules.
1073-
if [ "$(echo "$cmds" | wc -w)" != 1 ]; then
1074-
die "ambiguous deploy/kubernetes/rbac.yaml: need exactly one command, got: $cmds"
1081+
# For components with multiple cmds, the RBAC file should be in the following format:
1082+
# rbac-$cmd.yaml
1083+
# If this file cannot be found, we can default to the standard location:
1084+
# deploy/kubernetes/rbac.yaml
1085+
rbac_file_path=$(find . -type f -name "rbac-$i.yaml")
1086+
if [ "$rbac_file_path" == "" ]; then
1087+
rbac_file_path="$(pwd)/deploy/kubernetes/rbac.yaml"
10751088
fi
1076-
e=$(echo "$cmds" | tr '[:lower:]' '[:upper:]' | tr - _)
1077-
images="$images ${e}_RBAC=$(pwd)/deploy/kubernetes/rbac.yaml"
1078-
fi
1089+
1090+
if [ -e "$rbac_file_path" ]; then
1091+
# This is one of those components which has its own RBAC rules (like external-provisioner).
1092+
# We are testing a locally built image and also want to test with the the current,
1093+
# potentially modified RBAC rules.
1094+
e=$(echo "$i" | tr '[:lower:]' '[:upper:]' | tr - _)
1095+
images="$images ${e}_RBAC=$rbac_file_path"
1096+
fi
1097+
done
10791098
fi
10801099

10811100
if tests_need_non_alpha_cluster; then
@@ -1183,3 +1202,23 @@ main () {
11831202

11841203
return "$ret"
11851204
}
1205+
1206+
# This function can be called by a repo's top-level cloudbuild.sh:
1207+
# it handles environment set up in the GCR cloud build and then
1208+
# invokes "make push-multiarch" to do the actual image building.
1209+
gcr_cloud_build () {
1210+
# Register gcloud as a Docker credential helper.
1211+
# Required for "docker buildx build --push".
1212+
gcloud auth configure-docker
1213+
1214+
if find . -name Dockerfile | grep -v ^./vendor | xargs --no-run-if-empty cat | grep -q ^RUN; then
1215+
# Needed for "RUN" steps on non-linux/amd64 platforms.
1216+
# See https://github.com/multiarch/qemu-user-static#getting-started
1217+
(set -x; docker run --rm --privileged multiarch/qemu-user-static --reset -p yes)
1218+
fi
1219+
1220+
# Extract tag-n-hash value from GIT_TAG (form vYYYYMMDD-tag-n-hash) for REV value.
1221+
REV=v$(echo "$GIT_TAG" | cut -f3- -d 'v')
1222+
1223+
run_with_go "${CSI_PROW_GO_VERSION_BUILD}" make push-multiarch REV="${REV}" REGISTRY_NAME="${REGISTRY_NAME}" BUILD_PLATFORMS="${CSI_PROW_BUILD_PLATFORMS}"
1224+
}

travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ git:
66
depth: false
77
matrix:
88
include:
9-
- go: 1.13.3
9+
- go: 1.15
1010
before_script:
1111
- mkdir -p bin
1212
- wget https://github.com/golang/dep/releases/download/v0.5.1/dep-linux-amd64 -O bin/dep

0 commit comments

Comments
 (0)