Created
June 29, 2022 10:09
-
-
Save jmesnil/c532b390af888ca03ff5cfc80e82b312 to your computer and use it in GitHub Desktop.
Import EAP S2I JDK11 images in OpenShift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################################## | |
# Import EAP S2I JDK11 images in OpenShift | |
########################################## | |
# | |
# This script is used import unreleased S2I images in OpenShift image registry. | |
# It accepts 3 parameters: | |
# | |
# 1. the unreleased EAP S2I Builder image (e.g. registry-proxy.engineering.redhat.com/...) | |
# 2. the unreleased EAP S2I RUNTIME image (r.g. registry-proxy.engineering.redhat.com/...) | |
# 3. the OpenShift image registry (default-route-openshift-image-registry.apps.sandbox.x8i5.p1.openshiftapps.com) | |
################################ | |
# Command Arguments | |
################################ | |
EAP_S2I_BUILDER_IMAGE=$1 | |
EAP_S2I_RUNTIME_IMAGE=$2 | |
OC_IMAGE_REGISTRY=$3 | |
OC_NAMESPACE=$(oc project -q) | |
EAP_BUILDER_IMAGESTREAM=eap8-openjdk11-builder-openshift-rhel8 | |
EAP_RUNTIME_IMAGESTREAM=eap8-openjdk11-runtime-openshift-rhel8 | |
oc registry login | |
docker login -u openshift -p $(oc whoami -t) $OC_IMAGE_REGISTRY | |
docker pull $EAP_S2I_BUILDER_IMAGE | |
docker tag $EAP_S2I_BUILDER_IMAGE $OC_IMAGE_REGISTRY/$OC_NAMESPACE/$EAP_BUILDER_IMAGESTREAM | |
docker push $OC_IMAGE_REGISTRY/$OC_NAMESPACE/$EAP_BUILDER_IMAGESTREAM | |
docker pull $EAP_S2I_RUNTIME_IMAGE | |
docker tag $EAP_S2I_RUNTIME_IMAGE $OC_IMAGE_REGISTRY/$OC_NAMESPACE/$EAP_RUNTIME_IMAGESTREAM | |
docker push $OC_IMAGE_REGISTRY/$OC_NAMESPACE/$EAP_RUNTIME_IMAGESTREAM | |
oc get imagestream/$EAP_BUILDER_IMAGESTREAM | |
oc get imagestream/$EAP_RUNTIME_IMAGESTREAM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment