Skip to content

Commit 3d22132

Browse files
author
k8s-merge-robot
authored
Merge pull request kubernetes#28233 from zmerlynn/revert-revert-28172
Automatic merge from submit-queue Revert revert of kubernetes#28172 We're going to try reintroducing just the build changes in kubernetes#28172, get signal off of that, and wait on re-introducing kubernetes#28193. I also setup the `gke-updown` job for faster signal: kubernetes/test-infra#239. This reverts commit fe64293. [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2 parents 3a6494e + ae313b6 commit 3d22132

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

build/common.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,16 @@ function kube::release::gcs::copy_release_artifacts() {
12111211
fi
12121212

12131213
gsutil ls -lhr "${gcs_destination}" || return 1
1214+
1215+
if [[ -n "${KUBE_GCS_RELEASE_BUCKET_MIRROR:-}" ]]; then
1216+
local -r gcs_mirror="gs://${KUBE_GCS_RELEASE_BUCKET_MIRROR}/${KUBE_GCS_RELEASE_PREFIX}"
1217+
kube::log::status "Mirroring build to ${gcs_mirror}"
1218+
gsutil -q -m "${gcs_options[@]+${gcs_options[@]}}" rsync -d -r "${gcs_destination}" "${gcs_mirror}" || return 1
1219+
if [[ ${KUBE_GCS_MAKE_PUBLIC} =~ ^[yY]$ ]]; then
1220+
kube::log::status "Marking all uploaded mirror objects public"
1221+
gsutil -q -m acl ch -R -g all:R "${gcs_mirror}" >/dev/null 2>&1 || return 1
1222+
fi
1223+
fi
12141224
}
12151225

12161226
# Publish a new ci version, (latest,) but only if the release files actually
@@ -1475,7 +1485,19 @@ function kube::release::gcs::verify_ci_ge() {
14751485
# If new version is greater than the GCS version
14761486
function kube::release::gcs::publish() {
14771487
local -r publish_file="${1-}"
1478-
local -r publish_file_dst="gs://${KUBE_GCS_RELEASE_BUCKET}/${publish_file}"
1488+
1489+
kube::release::gcs::publish_to_bucket "${KUBE_GCS_RELEASE_BUCKET}" "${publish_file}" || return 1
1490+
1491+
if [[ -n "${KUBE_GCS_RELEASE_BUCKET_MIRROR:-}" ]]; then
1492+
kube::release::gcs::publish_to_bucket "${KUBE_GCS_RELEASE_BUCKET_MIRROR}" "${publish_file}" || return 1
1493+
fi
1494+
}
1495+
1496+
1497+
function kube::release::gcs::publish_to_bucket() {
1498+
local -r publish_bucket="${1}"
1499+
local -r publish_file="${2}"
1500+
local -r publish_file_dst="gs://${publish_bucket}/${publish_file}"
14791501

14801502
mkdir -p "${RELEASE_STAGE}/upload" || return 1
14811503
echo "${KUBE_GCS_PUBLISH_VERSION}" > "${RELEASE_STAGE}/upload/latest" || return 1
@@ -1488,7 +1510,7 @@ function kube::release::gcs::publish() {
14881510
gsutil acl ch -R -g all:R "${publish_file_dst}" >/dev/null 2>&1 || return 1
14891511
gsutil setmeta -h "Cache-Control:private, max-age=0" "${publish_file_dst}" >/dev/null 2>&1 || return 1
14901512
# If public, validate public link
1491-
local -r public_link="https://storage.googleapis.com/${KUBE_GCS_RELEASE_BUCKET}/${publish_file}"
1513+
local -r public_link="https://storage.googleapis.com/${publish_bucket}/${publish_file}"
14921514
kube::log::status "Validating uploaded version file at ${public_link}"
14931515
contents="$(curl -s "${public_link}")"
14941516
else

build/push-ci-build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ KUBE_GCS_MAKE_PUBLIC='y'
3131
KUBE_GCS_UPLOAD_RELEASE='y'
3232
KUBE_GCS_DELETE_EXISTING='n'
3333
: ${KUBE_GCS_RELEASE_BUCKET:='kubernetes-release'}
34+
: ${KUBE_GCS_RELEASE_BUCKET_MIRROR:='kubernetes-release-dev'}
3435
KUBE_GCS_RELEASE_PREFIX="ci/${LATEST}"
3536
KUBE_GCS_PUBLISH_VERSION="${LATEST}"
3637

0 commit comments

Comments
 (0)