Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #189 from manywho/feature/flow-3808
Browse files Browse the repository at this point in the history
Migrate to ecr
  • Loading branch information
robert-lilleker authored Sep 8, 2021
2 parents bfcf0c6 + 5dbd26b commit fefc48e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
#!/bin/sh
#!/bin/bash

set -e

FLOW_ECR_REGISTRY="093652424831.dkr.ecr.eu-west-2.amazonaws.com"
BRANCH_NAME="${bamboo_planRepository_branchName}"

docker login --username AWS --password "${PASS}" "${FLOW_ECR_REGISTRY}"

if [ "$BRANCH_NAME" = "" ]; then
echo "No bamboo_planRepository_branchName environment variable is set" 1>&2
exit 1
fi

if [ "$BRANCH_NAME" = "develop" ]; then
# We're building the base branch, so we want to push the "latest" tag
docker build -t quay.io/manywho/ui-runtime:latest .
docker push quay.io/manywho/ui-runtime:latest
docker build -t "${FLOW_ECR_REGISTRY}"/ui-runtime:latest .
docker push "${FLOW_ECR_REGISTRY}"/ui-runtime:latest
fi

# Replace the slashes in branch names with dashes, so we can use it as an image tag
IMAGE_TAG=`echo ${BRANCH_NAME} | sed -e "s/\//-/g"`
IMAGE="quay.io/manywho/ui-runtime:${IMAGE_TAG}"
IMAGE_TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//-/g")
IMAGE="${FLOW_ECR_REGISTRY}/ui-runtime:${IMAGE_TAG}"

# We always want to push the "branched" image tag too
docker build -t ${IMAGE} .
docker push ${IMAGE}
docker build -t "${IMAGE}" .
docker push "${IMAGE}"

0 comments on commit fefc48e

Please sign in to comment.