Skip to content

Instantly share code, notes, and snippets.

@danlopez
Last active August 29, 2015 14:11
Show Gist options
  • Save danlopez/dc0166fe85f39f15c4a7 to your computer and use it in GitHub Desktop.
Save danlopez/dc0166fe85f39f15c4a7 to your computer and use it in GitHub Desktop.
case $1 in
deploy)
docker run -it --rm -e "AWS_ACCESS_KEY_ID=$(printenv AWS_ACCESS_KEY_ID)" -e "AWS_SECRET_ACCESS_KEY=$(printenv AWS_SECRET_ACCESS_KEY)" -v ~/.ssh:/host-ssh apprennet/orchestrate /bin/bash -c \
"cp /host-ssh/* /root/.ssh/ && chmod 400 /root/.ssh/* && ruby tasks/trigger_deploy_pull.rb $2"
;;
status)
docker run -it --rm -e "AWS_ACCESS_KEY_ID=$(printenv AWS_ACCESS_KEY_ID)" -e "AWS_SECRET_ACCESS_KEY=$(printenv AWS_SECRET_ACCESS_KEY)" -v ~/.ssh:/host-ssh apprennet/orchestrate /bin/bash -c \
"watch -n 3 ruby tasks/container_status.rb $2"
;;
shell)
docker run -it --rm -e "AWS_ACCESS_KEY_ID=$(printenv AWS_ACCESS_KEY_ID)" -e "AWS_SECRET_ACCESS_KEY=$(printenv AWS_SECRET_ACCESS_KEY)" -v ~/.ssh:/host-ssh apprennet/orchestrate /bin/bash -c \
"/bin/bash"
;;
*)
echo "Usage: orchestrate [deploy|status|shell] [development|staging|production]"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment