Skip to content

Commit

Permalink
[Ops] Added log lines in build_and_release_image.sh.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarciani committed Oct 16, 2023
1 parent 7a9e686 commit 6943988
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/build_and_release_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,30 @@ elif ! [[ $TAG =~ [0-9]{4}\.(0[1-9]|1[0-2])\.[0-9]+ ]]; then
exit 1
fi

echo "[INFO] Logging in ${ECR_ENDPOINT}"
aws ecr-public get-login-password --region "$ECR_REGION" | docker login --username AWS --password-stdin "${ECR_ENDPOINT}"

echo "[INFO] Building frontend"

pushd frontend
if [ ! -d node_modules ]; then
npm install
fi

echo "[INFO] Building image"
docker build --build-arg PUBLIC_URL=/ -t frontend-awslambda .
popd
docker build -f Dockerfile.awslambda -t ${ECR_REPO} .

ECR_IMAGE_VERSION_TAGGED=${ECR_ENDPOINT}/${ECR_REPO}:${TAG}
ECR_IMAGE_LATEST_TAGGED=${ECR_ENDPOINT}/${ECR_REPO}:latest

echo "[INFO] Pushing image ${ECR_IMAGE_VERSION_TAGGED} in repository ${ECR_REPO}"

docker tag ${ECR_REPO} ${ECR_IMAGE_VERSION_TAGGED}
docker push ${ECR_IMAGE_VERSION_TAGGED}

docker tag ${ECR_REPO} ${ECR_IMAGE_LATEST_TAGGED}
docker push ${ECR_IMAGE_LATEST_TAGGED}

echo "Uploaded: ${ECR_IMAGE_VERSION_TAGGED}, ${ECR_IMAGE_LATEST_TAGGED}"
echo "[INFO] Uploaded: ${ECR_IMAGE_VERSION_TAGGED}, ${ECR_IMAGE_LATEST_TAGGED}"

0 comments on commit 6943988

Please sign in to comment.