diff --git a/scripts/helper_to_push_internal_images_2hub.sh b/scripts/helper_to_push_docker_image.sh similarity index 100% rename from scripts/helper_to_push_internal_images_2hub.sh rename to scripts/helper_to_push_docker_image.sh diff --git a/scripts/helper_to_push_manifest.sh b/scripts/helper_to_push_docker_manifest.sh similarity index 100% rename from scripts/helper_to_push_manifest.sh rename to scripts/helper_to_push_docker_manifest.sh diff --git a/scripts/helper_to_push_ubiquity_images_and_manifests.sh b/scripts/helper_to_push_ubiquity_images_and_manifests.sh index 43d49384..e31f83ff 100755 --- a/scripts/helper_to_push_ubiquity_images_and_manifests.sh +++ b/scripts/helper_to_push_ubiquity_images_and_manifests.sh @@ -10,7 +10,7 @@ # 1. Run docker login to the external registry in advance. # 2. The internal images should be exist in advance. # 3. The external images should NOT be exist (the script will creates them). -# 4. Helper scripts should be accessible: ./helper_to_push_internal_images_2hub.sh and ./helper_to_push_manifest.sh +# 4. Helper scripts should be accessible: ./helper_to_push_docker_image.sh and ./helper_to_push_docker_manifest.sh # 5. Scripts input comes from environment variables, see ubiquity_*_envs and optional TAG_LATEST # ---------------------------------------------------------------- @@ -19,9 +19,12 @@ ubiquity_db_envs="in_UBIQUITY_DB_IMAGE_AMD64 out_UBIQUITY_DB_IMAGE_AMD64 in_UBIQ ubiquity_provisioner_envs="in_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 out_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 in_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE out_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE out_UBIQUITY_K8S_PROVISIONER_IMAGE_MULTIARCH" ubiquity_flex_envs="in_UBIQUITY_K8S_FLEX_IMAGE_AMD64 out_UBIQUITY_K8S_FLEX_IMAGE_AMD64 in_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE out_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE out_UBIQUITY_K8S_FLEX_IMAGE_MULTIARCH" +HELPER_PUSH_IMAGE=./helper_to_push_docker_image.sh +HELPER_PUSH_MANIFEST=./helper_to_push_docker_manifest.sh + date # Validations -[ -f ./helper_to_push_internal_images_2hub.sh -a -f ./helper_to_push_manifest.sh ] && : || exit 1 +[ -f $HELPER_PUSH_IMAGE -a -f $HELPER_PUSH_MANIFEST ] && : || exit 1 for expected_env in $ubiquity_envs $ubiquity_db_envs $ubiquity_provisioner_envs $ubiquity_flex_envs; do [ -z "`printenv $expected_env`" ] && { echo "Error: expected env [$expected_env] does not exist. Please set it first."; exit 1; } || : echo "$expected_env=`printenv $expected_env`" @@ -31,44 +34,44 @@ echo "TAG_LATEST=$TAG_LATEST" echo "" echo "Start to push Ubiquity images and manifests..." -./helper_to_push_internal_images_2hub.sh $in_UBIQUITY_IMAGE_AMD64 $out_UBIQUITY_IMAGE_AMD64 $TAG_LATEST -./helper_to_push_internal_images_2hub.sh $in_UBIQUITY_IMAGE_PPC64LE $out_UBIQUITY_IMAGE_PPC64LE $TAG_LATEST -./helper_to_push_manifest.sh $out_UBIQUITY_IMAGE_MULTIARCH $out_UBIQUITY_IMAGE_AMD64 $out_UBIQUITY_IMAGE_PPC64LE +$HELPER_PUSH_IMAGE $in_UBIQUITY_IMAGE_AMD64 $out_UBIQUITY_IMAGE_AMD64 $TAG_LATEST +$HELPER_PUSH_IMAGE $in_UBIQUITY_IMAGE_PPC64LE $out_UBIQUITY_IMAGE_PPC64LE $TAG_LATEST +$HELPER_PUSH_MANIFEST $out_UBIQUITY_IMAGE_MULTIARCH $out_UBIQUITY_IMAGE_AMD64 $out_UBIQUITY_IMAGE_PPC64LE if [ -n "$TAG_LATEST" ]; then latest_external_image=`echo $out_UBIQUITY_IMAGE_MULTIARCH | sed "s|^\(.*/.*:\)\(.*\)$|\1$TAG_LATEST|"` # replace tag with $TAG_LATEST - ./helper_to_push_manifest.sh $latest_external_image $out_UBIQUITY_IMAGE_AMD64 $out_UBIQUITY_IMAGE_PPC64LE + $HELPER_PUSH_MANIFEST $latest_external_image $out_UBIQUITY_IMAGE_AMD64 $out_UBIQUITY_IMAGE_PPC64LE no fi echo "" echo "Start to push Ubiquity DB images and manifests..." -./helper_to_push_internal_images_2hub.sh $in_UBIQUITY_DB_IMAGE_AMD64 $out_UBIQUITY_DB_IMAGE_AMD64 $TAG_LATEST -./helper_to_push_internal_images_2hub.sh $in_UBIQUITY_DB_IMAGE_PPC64LE $out_UBIQUITY_DB_IMAGE_PPC64LE $TAG_LATEST -./helper_to_push_manifest.sh $out_UBIQUITY_DB_IMAGE_MULTIARCH $out_UBIQUITY_DB_IMAGE_AMD64 $out_UBIQUITY_DB_IMAGE_PPC64LE $TAG_LATEST +$HELPER_PUSH_IMAGE $in_UBIQUITY_DB_IMAGE_AMD64 $out_UBIQUITY_DB_IMAGE_AMD64 $TAG_LATEST +$HELPER_PUSH_IMAGE $in_UBIQUITY_DB_IMAGE_PPC64LE $out_UBIQUITY_DB_IMAGE_PPC64LE $TAG_LATEST +$HELPER_PUSH_MANIFEST $out_UBIQUITY_DB_IMAGE_MULTIARCH $out_UBIQUITY_DB_IMAGE_AMD64 $out_UBIQUITY_DB_IMAGE_PPC64LE $TAG_LATEST if [ -n "$TAG_LATEST" ]; then latest_external_image=`echo $out_UBIQUITY_DB_IMAGE_MULTIARCH | sed "s|^\(.*/.*:\)\(.*\)$|\1$TAG_LATEST|"` # replace tag with $TAG_LATEST - ./helper_to_push_manifest.sh $latest_external_image $out_UBIQUITY_DB_IMAGE_AMD64 $out_UBIQUITY_DB_IMAGE_PPC64LE $TAG_LATEST + $HELPER_PUSH_MANIFEST $latest_external_image $out_UBIQUITY_DB_IMAGE_AMD64 $out_UBIQUITY_DB_IMAGE_PPC64LE no fi echo "" echo "Start to push Ubiquity provisioner images and manifests..." -./helper_to_push_internal_images_2hub.sh $in_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 $out_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 $TAG_LATEST -./helper_to_push_internal_images_2hub.sh $in_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE $out_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE $TAG_LATEST -./helper_to_push_manifest.sh $out_UBIQUITY_K8S_PROVISIONER_IMAGE_MULTIARCH $out_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 $out_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE $TAG_LATEST +$HELPER_PUSH_IMAGE $in_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 $out_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 $TAG_LATEST +$HELPER_PUSH_IMAGE $in_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE $out_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE $TAG_LATEST +$HELPER_PUSH_MANIFEST $out_UBIQUITY_K8S_PROVISIONER_IMAGE_MULTIARCH $out_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 $out_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE $TAG_LATEST if [ -n "$TAG_LATEST" ]; then latest_external_image=`echo $out_UBIQUITY_K8S_PROVISIONER_IMAGE_MULTIARCH | sed "s|^\(.*/.*:\)\(.*\)$|\1$TAG_LATEST|"` # replace tag with $TAG_LATEST - ./helper_to_push_manifest.sh $latest_external_image $out_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 $out_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE $TAG_LATEST + $HELPER_PUSH_MANIFEST $latest_external_image $out_UBIQUITY_K8S_PROVISIONER_IMAGE_AMD64 $out_UBIQUITY_K8S_PROVISIONER_IMAGE_PPC64LE no fi echo "" echo "Start to push Ubiquity flex images and manifests..." -./helper_to_push_internal_images_2hub.sh $in_UBIQUITY_K8S_FLEX_IMAGE_AMD64 $out_UBIQUITY_K8S_FLEX_IMAGE_AMD64 $TAG_LATEST -./helper_to_push_internal_images_2hub.sh $in_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE $out_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE $TAG_LATEST -./helper_to_push_manifest.sh $out_UBIQUITY_K8S_FLEX_IMAGE_MULTIARCH $out_UBIQUITY_K8S_FLEX_IMAGE_AMD64 $out_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE $TAG_LATEST +$HELPER_PUSH_IMAGE $in_UBIQUITY_K8S_FLEX_IMAGE_AMD64 $out_UBIQUITY_K8S_FLEX_IMAGE_AMD64 $TAG_LATEST +$HELPER_PUSH_IMAGE $in_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE $out_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE $TAG_LATEST +$HELPER_PUSH_MANIFEST $out_UBIQUITY_K8S_FLEX_IMAGE_MULTIARCH $out_UBIQUITY_K8S_FLEX_IMAGE_AMD64 $out_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE $TAG_LATEST if [ -n "$TAG_LATEST" ]; then latest_external_image=`echo $out_UBIQUITY_K8S_FLEX_IMAGE_MULTIARCH | sed "s|^\(.*/.*:\)\(.*\)$|\1$TAG_LATEST|"` # replace tag with $TAG_LATEST - ./helper_to_push_manifest.sh $latest_external_image $out_UBIQUITY_K8S_FLEX_IMAGE_AMD64 $out_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE $TAG_LATEST + $HELPER_PUSH_MANIFEST $latest_external_image $out_UBIQUITY_K8S_FLEX_IMAGE_AMD64 $out_UBIQUITY_K8S_FLEX_IMAGE_PPC64LE no fi