Skip to content

Commit

Permalink
remove geo replication (#390)
Browse files Browse the repository at this point in the history
Co-authored-by: upodroid <upodroid@users.noreply.github.com>
  • Loading branch information
knative-prow-robot and upodroid authored Aug 1, 2024
1 parent b979959 commit ef3b057
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,36 +33,12 @@ readonly RELEASE_GCR="gcr.io/knative-releases/github.com/${ORG_NAME}/${REPO_NAME
readonly NIGHTLY_SIGNING_IDENTITY="signer@knative-nightly.iam.gserviceaccount.com"
readonly RELEASE_SIGNING_IDENTITY="signer@knative-releases.iam.gserviceaccount.com"

# Georeplicate images to {us,eu,asia}.gcr.io
readonly GEO_REPLICATION=(us eu asia)

# Simple banner for logging purposes.
# Parameters: $1 - message to display.
function banner() {
make_banner "@" "$1"
}

# Tag images in the yaml files if $TAG is not empty.
# $KO_DOCKER_REPO is the registry containing the images to tag with $TAG.
# Parameters: $1..$n - files to parse for images (non .yaml files are ignored).
function tag_images_in_yamls() {
[[ -z ${TAG} ]] && return 0
local SRC_DIR="${GOPATH}/src/"
local DOCKER_BASE="${KO_DOCKER_REPO}/${REPO_ROOT_DIR/$SRC_DIR}"
local GEO_REGIONS="${GEO_REPLICATION[@]} "
echo "Tagging any images under '${DOCKER_BASE}' with ${TAG}"
# shellcheck disable=SC2068
for file in $@; do
[[ "${file##*.}" != "yaml" ]] && continue
echo "Inspecting ${file}"
for image in $(grep -o "${DOCKER_BASE}/[a-z\./-]\+@sha256:[0-9a-f]\+" "${file}"); do
for region in "" ${GEO_REGIONS// /. }; do
gcloud -q container images add-tag "${image}" "${region}${image%%@*}:${TAG}"
done
done
done
}

# Copy the given files to the $RELEASE_GCS_BUCKET bucket's "latest" directory.
# If $TAG is not empty, also copy them to $RELEASE_GCS_BUCKET bucket's "previous" directory.
# Parameters: $1..$n - files to copy.
Expand Down Expand Up @@ -646,7 +622,6 @@ function run_validation_tests() {
# Parameters: $1..$n - files to add to the release.
function publish_artifacts() {
(( ! PUBLISH_RELEASE )) && return
tag_images_in_yamls "${ARTIFACTS_TO_PUBLISH}"
if [[ -n "${RELEASE_DIR}" ]]; then
cp "${ARTIFACTS_TO_PUBLISH}" "${RELEASE_DIR}" || abort "cannot copy release to '${RELEASE_DIR}'"
fi
Expand Down

0 comments on commit ef3b057

Please sign in to comment.