Skip to content

Commit 379f583

Browse files
Allow a new OS_PUSH_BASE_REPO flag to push-release
Will allow us to rename images from openshift/* locally to a different name when we push, for example to a per PR image repository.
1 parent a1d5364 commit 379f583

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

hack/lib/constants.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -314,24 +314,24 @@ readonly -f os::build::clean_windows_versioninfo
314314

315315
# OS_ALL_IMAGES is the list of images built by os::build::images.
316316
readonly OS_ALL_IMAGES=(
317-
openshift/origin
318-
openshift/origin-base
319-
openshift/origin-pod
320-
openshift/origin-deployer
321-
openshift/origin-docker-builder
322-
openshift/origin-keepalived-ipfailover
323-
openshift/origin-sti-builder
324-
openshift/origin-haproxy-router
325-
openshift/origin-f5-router
326-
openshift/origin-egress-router
327-
openshift/origin-egress-http-proxy
328-
openshift/origin-recycler
329-
openshift/origin-cluster-capacity
330-
openshift/origin-service-catalog
331-
openshift/origin-template-service-broker
332-
openshift/hello-openshift
333-
openshift/openvswitch
334-
openshift/node
317+
origin
318+
origin-base
319+
origin-pod
320+
origin-deployer
321+
origin-docker-builder
322+
origin-keepalived-ipfailover
323+
origin-sti-builder
324+
origin-haproxy-router
325+
origin-f5-router
326+
origin-egress-router
327+
origin-egress-http-proxy
328+
origin-recycler
329+
origin-cluster-capacity
330+
origin-service-catalog
331+
origin-template-service-broker
332+
hello-openshift
333+
openvswitch
334+
node
335335
)
336336

337337
# os::build::images builds all images in this repo.

hack/push-release.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ fi
4141

4242
images=( "${OS_ALL_IMAGES[@]}" )
4343

44+
OS_PUSH_BASE_REPO="${OS_PUSH_BASE_REPO:-openshift/}"
45+
4446
PUSH_OPTS=""
4547
if docker push --help | grep -q force; then
4648
PUSH_OPTS="--force"
@@ -50,10 +52,10 @@ fi
5052
if [[ "${tag}" != ":latest" ]]; then
5153
if [[ -z "${OS_PUSH_LOCAL-}" ]]; then
5254
for image in "${images[@]}"; do
53-
docker pull "${OS_PUSH_BASE_REGISTRY-}${image}:${source_tag}"
55+
docker pull "${OS_PUSH_BASE_REGISTRY-}openshift/${image}:${source_tag}"
5456
done
5557
else
56-
os::log::warning "Pushing local :${source_tag} images to ${OS_PUSH_BASE_REGISTRY-}*${tag}"
58+
os::log::warning "Pushing local :${source_tag} images to ${OS_PUSH_BASE_REGISTRY-}${OS_PUSH_BASE_REPO}*${tag}"
5759
if [[ -z "${OS_PUSH_ALWAYS:-}" ]]; then
5860
echo " CTRL+C to cancel, or any other key to continue"
5961
read
@@ -65,15 +67,15 @@ IFS=',' read -r -a tags <<< "$tag"
6567
if [[ "${OS_PUSH_BASE_REGISTRY-}" != "" || "${tag}" != "" ]]; then
6668
for image in "${images[@]}"; do
6769
for tag in "${tags[@]}"; do
68-
docker tag "${image}:${source_tag}" "${OS_PUSH_BASE_REGISTRY-}${image}${tag}"
70+
docker tag "openshift/${image}:${source_tag}" "${OS_PUSH_BASE_REGISTRY-}${OS_PUSH_BASE_REPO}${image}${tag}"
6971
done
7072
done
7173
fi
7274

7375
for image in "${images[@]}"; do
7476
for tag in "${tags[@]}"; do
75-
os::log::info "Pushing ${OS_PUSH_BASE_REGISTRY-}${image}${tag}..."
76-
docker push ${PUSH_OPTS} "${OS_PUSH_BASE_REGISTRY-}${image}${tag}"
77+
os::log::info "Pushing ${OS_PUSH_BASE_REGISTRY-}${OS_PUSH_BASE_REPO}${image}${tag}..."
78+
docker push ${PUSH_OPTS} "${OS_PUSH_BASE_REGISTRY-}${OS_PUSH_BASE_REPO}${image}${tag}"
7779
done
7880
done
7981

0 commit comments

Comments
 (0)