From 4496a72e89134788a788544fbd35dd48b133ffb5 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sun, 1 Nov 2020 22:02:16 -0800 Subject: [PATCH] Updated to latest xe-solutions Signed-off-by: James Ketrenos --- scripts/build-dockerfile.sh | 8 ++++---- scripts/promote-image.sh | 2 +- scripts/push-image.sh | 24 ++++++++++++++++++------ scripts/trigger.sh | 4 ++-- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/scripts/build-dockerfile.sh b/scripts/build-dockerfile.sh index d1a3931..bd277a1 100755 --- a/scripts/build-dockerfile.sh +++ b/scripts/build-dockerfile.sh @@ -62,12 +62,12 @@ if [[ "${BUILD}" != "" ]] && [[ "${BUILD}" != "N/A" ]]; then groovy) ARTIFACTORY_RELEASE=20.10 ;; # Groovy Gorilla esac ARTIFACTORY_RELEASE=${ARTIFACTORY_RELEASE:-${OS_RELEASE}} - + VARS+=(ARTIFACTORY_PATH ARTIFACTORY_RELEASE) export ARTIFACTORY_RELEASE export ARTIFACTORY_PATH - + TAG_SUFFIX=${BUILD} else TAG_SUFFIX=${PACKAGE_STREAM} @@ -101,7 +101,7 @@ for snippet in templates/??-*.in templates/${OS_DISTRO}/??-*.in; do if [[ "${TEMPLATE_IGNORE}" != "" ]] && [[ ${snippet} =~ ${TEMPLATE_IGNORE} ]]; then continue fi - + SNIPPETS+=($snippet) done @@ -127,7 +127,7 @@ for snippet in ${SNIPPETS[@]}; do if [[ ${snippet} =~ ..-repositories-intel-com.in ]]; then continue fi - else + else # If a build was NOT specified, then do not include ??-local-file-intel-repo.in and if [[ ${snippet} =~ ..-local-file-intel-repo.in ]]; then continue diff --git a/scripts/promote-image.sh b/scripts/promote-image.sh index 51537e9..d29900e 100755 --- a/scripts/promote-image.sh +++ b/scripts/promote-image.sh @@ -110,7 +110,7 @@ while (( iter )); do if docker push ${REGISTRY_URL}/${CONTAINER}:latest-${TARGET_TAG}; then break fi - fail "Unable to push ${CONTAINER}:latest-${TARGET_TAG}" + echo "Unable to push ${CONTAINER}:latest-${TARGET_TAG}" iter=$((iter-1)) if (( ! iter )); then fail "No more tries." diff --git a/scripts/push-image.sh b/scripts/push-image.sh index 58b9121..f2aeb9d 100755 --- a/scripts/push-image.sh +++ b/scripts/push-image.sh @@ -16,12 +16,24 @@ RELEASE_INFO=${RELEASE_INFO:-N/A} TAG=${TAG:-test-${OS_DISTRO}-${PACKAGE_STREAM}-${RELEASE_INFO}} } -docker tag ${CONTAINER}:${TAG} ${REGISTRY_URL}/${CONTAINER}:${TAG} \ - && docker push ${REGISTRY_URL}/${CONTAINER}:${TAG} \ - || { - echo "Unable to tag and push image to ${REGISTRY_URL}." - exit 1 -} +if ! docker tag ${CONTAINER}:${TAG} ${REGISTRY_URL}/${CONTAINER}:${TAG}; then + fail "Unable to tag .../${CONTAINER}:${TAG}" +fi + +iter=5 +while (( iter )); do + echo "Pushing as .../${CONTAINER}:${TAG}" + if docker push ${REGISTRY_URL}/${CONTAINER}:${TAG}; then + break + fi + echo "Unable to tag and push image to ${REGISTRY_URL}." + iter=$((iter-1)) + if (( ! iter )); then + fail "No more tries." + fi + echo "Waiting 10s before trying again..." + sleep 10 +done [[ "${TAG}" =~ "test-*" ]] && { cat << EOM diff --git a/scripts/trigger.sh b/scripts/trigger.sh index eb8f867..15126c1 100755 --- a/scripts/trigger.sh +++ b/scripts/trigger.sh @@ -67,8 +67,8 @@ CURL=$(which curl) # The following constants are used so we can run trigger.sh # against a known build -BUILD=${BUILD:-7517585} -BRANCH=${BRANCH:-releases_19.4} +BUILD=${BUILD:-N/A} +BRANCH=${BRANCH:-untested} REF=${REF:-master} PROJECT=${PROJECT:-${CONTAINER}}