Skip to content

Instantly share code, notes, and snippets.

@daisuke-morita
Created February 7, 2016 03:56
Embed
What would you like to do?
deploy-to-staging.sh - リリースパッケージをアプリケーションサーバーにホットデプロイする
#!/bin/bash
set -ex
export AWS_DEFAULT_REGION="ap-northeast-1"
SGID="sg-xxxxxxxx"
MYIP="`dig +short myip.opendns.com @resolver1.opendns.com`"
cd $(dirname $(readlink -f $0))
trap "aws ec2 revoke-security-group-ingress --group-id ${SGID} --protocol tcp --port 22 --cidr ${MYIP}/32" 0 1 2 3 15
aws ec2 authorize-security-group-ingress --group-id ${SGID} --protocol tcp --port 22 --cidr ${MYIP}/32
cd ../deploy && ./deploy-to-staging.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment