Skip to content

Instantly share code, notes, and snippets.

Last active Mar 19, 2020
What would you like to do?
declare TARGET=""
readonly VERSION=$(date '+%y.%m.%d') # Today's ubuntu version style.
readonly IMAGE_NAME=edith/edith-XXXX
readonly AWS_OTP=$(aws ecr get-login-password --region ap-northeast-2)
# Build
docker build -t ${IMAGE_NAME} .
# Push
echo "${AWS_OTP}" | docker login --username AWS --password-stdin ${ECR_REGISTRY}
docker tag edith/edith-XXXX:latest ${ECR_REGISTRY}:"${VERSION}"
docker push ${ECR_REGISTRY}:"${VERSION}"
# Deploy
ssh -i ~/.ssh/aws_skpark.pem ec2-user@${TARGET} "./ ${AWS_OTP}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment