Last active
June 23, 2019 12:47
-
-
Save levynir/ad4fe4c184bcfd61e16d6113b63cfa0e to your computer and use it in GitHub Desktop.
Script to build a docker for AWS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $(git diff --stat) != '' ]]; then | |
echo "*** ERROR *** GIT reports this directory to be dirty.Please commit and push to master before building "; exit 1 | |
fi | |
APPNAME=dayzz/dayzz-bi | |
REGION=us-east-2 | |
AWS_CMD=`aws ecr get-login --no-include-email --region $REGION` | |
AWS_URI=`echo $AWS_CMD | awk '{print $7}' | sed -E "s/https\:\/\///"` | |
$AWS_CMD | |
git pull origin master | |
docker build -t $APPNAME . | |
docker tag $APPNAME:latest $AWS_URI/$APPNAME | |
docker push $AWS_URI/$APPNAME | |
#CC BY (nir at dayzz.com) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment