Skip to content

Commit

Permalink
feat: update script to push docker image to ecr
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianruizmora committed Nov 18, 2024
1 parent 1cc821b commit 09cddbd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docker/hooks/updateDockerImageECR.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

DOCKER_IMAGE_NAME="wemap-osrm-frontend"
DOCKER_IMAGE_TAG="$([ ! -z "$1" ] && echo $1 || echo $(git rev-parse --short HEAD))"
AWS_ECR_REPO="028996598430.dkr.ecr.eu-west-1.amazonaws.com/$DOCKER_IMAGE_NAME"
AWS_DEFAULT_REGION="eu-west-1"

cd docker
docker build -t $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG -f Dockerfile ..
aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ECR_REPO
docker tag $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG $AWS_ECR_REPO:$DOCKER_IMAGE_TAG
docker push $AWS_ECR_REPO:$DOCKER_IMAGE_TAG

0 comments on commit 09cddbd

Please sign in to comment.