From a59f74a287addea93d85b5b02c8ef9860651a9db Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 20 Aug 2020 13:18:17 -0500 Subject: [PATCH] small cleanup --- .automation/upload-docker.sh | 27 +++++++++++++++++++-------- .github/workflows/deploy-PROD.yml | 2 +- .github/workflows/deploy-RELEASE.yml | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index d774305a..b5b0d941 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -148,13 +148,16 @@ ValidateInput() { fatal "[${IMAGE_REPO}]" else info "Successfully found:${F[W]}[IMAGE_REPO]${F[B]}, value:${F[W]}[${IMAGE_REPO}]" + # Set the docker Image repo DOCKER_IMAGE_REPO="${IMAGE_REPO}" ############################################### # Need to see if GCR registry and update name # ############################################### if [[ ${REGISTRY} == "GCR" ]]; then NAME="${GCR_URL}/${IMAGE_REPO}/${REPO_NAME}" + # Set the default image repo IMAGE_REPO="${NAME}" + # Set the GCR image repo GCR_IMAGE_REPO="${IMAGE_REPO}" info "Updated [IMAGE_REPO] to:[${IMAGE_REPO}] for GCR" fi @@ -469,10 +472,14 @@ FindBuiltImage() { # Check the local system to see if an image has already been built # if so, we only need to update tags and push # Set FOUND_IMAGE=1 when found - FOUND_DOCKER_RELASE=0 - FOUND_DOCKER_MAJOR=0 - FOUND_GCR_RELASE=0 - FOUND_GCR_MAJOR=0 + + ############## + # Local vars # + ############## + FOUND_DOCKER_RELASE=0 # Flag if docker relase image is found + FOUND_DOCKER_MAJOR=0 # Flag if docker major image is found + FOUND_GCR_RELASE=0 # Flag if GCR releasae image is found + FOUND_GCR_MAJOR=0 # Flag if GCR major image is found ####################################### # Look for Release image in DockerHub # @@ -489,6 +496,7 @@ FindBuiltImage() { ############################## if [ $ERROR_CODE -ne 0 ]; then info "Found Docker image:[$DOCKER_IMAGE_REPO:$IMAGE_VERSION] already built on instance" + # Increment flag FOUND_DOCKER_RELASE=1 else info "Failed to find locally created Docker image:[$DOCKERHUB_FIND_CMD]" @@ -509,6 +517,7 @@ FindBuiltImage() { ############################## if [ $ERROR_CODE -ne 0 ]; then info "Found Docker image:[$DOCKER_IMAGE_REPO:$MAJOR_TAG] already built on instance" + # Increment flag FOUND_DOCKER_MAJOR=1 else info "Failed to find locally created Docker image:[$DOCKERHUB_FIND_CMD]" @@ -529,6 +538,7 @@ FindBuiltImage() { ############################## if [ $ERROR_CODE -ne 0 ]; then info "Found Docker image:[$GCR_IMAGE_REPO:$IMAGE_VERSION] already built on instance" + # Increment flag FOUND_GCR_RELASE=1 else info "Failed to find locally created Docker image:[$GCR_FIND_CMD]" @@ -549,6 +559,7 @@ FindBuiltImage() { ############################## if [ $ERROR_CODE -ne 0 ]; then info "Found Docker image:[$GCR_IMAGE_REPO:$MAJOR_TAG] already built on instance" + # Increment flag FOUND_GCR_MAJOR=1 else info "Failed to find locally created Docker image:[$GCR_FIND_CMD]" @@ -614,12 +625,12 @@ if [[ ${REGISTRY} == "Docker" ]]; then # Authenticate "Username" "Password" "Url" "Name" Authenticate "${DOCKER_USERNAME}" "${DOCKER_PASSWORD}" "" "Dockerhub" -#################################### -# Login to GitHub Package Registry # -#################################### +###################################### +# Login to GitHub Container Registry # +###################################### elif [[ ${REGISTRY} == "GCR" ]]; then # Authenticate "Username" "Password" "Url" "Name" - Authenticate "${GCR_USERNAME}" "${GCR_TOKEN}" "https://${GCR_URL}" "GitHub Package Registry" + Authenticate "${GCR_USERNAME}" "${GCR_TOKEN}" "https://${GCR_URL}" "GitHub Container Registry" else ######### diff --git a/.github/workflows/deploy-PROD.yml b/.github/workflows/deploy-PROD.yml index 087de664..0a1bb3a6 100644 --- a/.github/workflows/deploy-PROD.yml +++ b/.github/workflows/deploy-PROD.yml @@ -65,6 +65,6 @@ jobs: IMAGE_REPO: github/super-linter IMAGE_VERSION: latest DOCKERFILE_PATH: Dockerfile - REGISTRY: GPR + REGISTRY: GCR shell: bash run: .automation/upload-docker.sh diff --git a/.github/workflows/deploy-RELEASE.yml b/.github/workflows/deploy-RELEASE.yml index 84e64f57..5eaa32ef 100644 --- a/.github/workflows/deploy-RELEASE.yml +++ b/.github/workflows/deploy-RELEASE.yml @@ -65,6 +65,6 @@ jobs: IMAGE_REPO: github/super-linter IMAGE_VERSION: ${{ github.event.release.tag_name }} DOCKERFILE_PATH: Dockerfile - REGISTRY: GPR + REGISTRY: GCR shell: bash run: .automation/upload-docker.sh