From 0ad5e1c6b4475dee8109fed9aa637e1dea4a754f Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Fri, 6 Sep 2024 12:41:45 -0400 Subject: [PATCH] - quoting paths - extra debugging --- .circleci/deployment/commands.yml | 2 +- scripts/build-and-tag-images.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/deployment/commands.yml b/.circleci/deployment/commands.yml index f435357ba..774cd1ee3 100644 --- a/.circleci/deployment/commands.yml +++ b/.circleci/deployment/commands.yml @@ -20,7 +20,7 @@ command: | ls pwd - ./scripts/build-and-tag-images.sh <> <> $CIRCLE_WORKING_DIRECTORY/tdrs-backend $CIRCLE_WORKING_DIRECTORY/tdrs-frontend $CIRCLE_BUILD_NUM $CIRCLE_SHA1 $CIRCI_DOCKER_LOGIN tdp-circi + ./scripts/build-and-tag-images.sh <> <> "$CIRCLE_WORKING_DIRECTORY/tdrs-backend" "$CIRCLE_WORKING_DIRECTORY/tdrs-frontend" $CIRCLE_BUILD_NUM $CIRCLE_SHA1 "$CIRCI_DOCKER_LOGIN" tdp-circi deploy-cloud-dot-gov: parameters: diff --git a/scripts/build-and-tag-images.sh b/scripts/build-and-tag-images.sh index 57b23c849..e172803fa 100755 --- a/scripts/build-and-tag-images.sh +++ b/scripts/build-and-tag-images.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e if [ "$#" -ne 8 ]; then echo "Error, this script expects 8 parameters." @@ -18,11 +19,14 @@ TAG="${BUILD_DATE}_build-${BUILD_NUM}_${COMMIT_HASH}" BUILD_DATE=`date +%F` +ls $BACKEND_PATH +ls $FRONTEND_PATH + build_and_tag() { echo "$DOCKER_LOGIN" | docker login https://tdp-docker.dev.raftlabs.tech -u $DOCKER_USER --password-stdin for platform in "linux/amd64" "linux/arm64"; do - docker build --platform $platform -t tdp-docker.dev.raftlabs.tech/$BACKEND_APP_NAME:$TAG -t tdp-docker.dev.raftlabs.tech/$BACKEND_APP_NAME:latest $BACKEND_PATH - docker build --platform $platform -t tdp-docker.dev.raftlabs.tech/$FRONTEND_APP_NAME:$TAG -t tdp-docker.dev.raftlabs.tech/$FRONTEND_APP_NAME:latest $FRONTEND_PATH + docker build --platform $platform -t tdp-docker.dev.raftlabs.tech/$BACKEND_APP_NAME:$TAG -t tdp-docker.dev.raftlabs.tech/$BACKEND_APP_NAME:latest "$BACKEND_PATH" + docker build --platform $platform -t tdp-docker.dev.raftlabs.tech/$FRONTEND_APP_NAME:$TAG -t tdp-docker.dev.raftlabs.tech/$FRONTEND_APP_NAME:latest "$FRONTEND_PATH" docker push tdp-docker.dev.raftlabs.tech/$BACKEND_APP_NAME --all-tags docker push tdp-docker.dev.raftlabs.tech/$FRONTEND_APP_NAME --all-tags