Last active
August 29, 2015 14:06
-
-
Save graymic/c6b0d18652feb0cc0242 to your computer and use it in GitHub Desktop.
Capistrano Deploy Shell
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
#!/usr/bin/env bash | |
command -v gem >/dev/null 2>&1 || { echo >&2 "Gem not installed, exiting."; exit 1; } | |
command -v cap >/dev/null 2>&1 || { | |
echo >&2 "Capistrano is required for deployments. Installing capistrano now..."; | |
gem install capistrano | |
} | |
if [ ! -d ".deploy" ]; then | |
echo ".deploy directory has not been setup. Please run the cap installer." | |
exit 1 | |
else | |
if [ ! -f ".deploy/config/deploy/$1.rb" ]; then | |
echo "Deployment for \"$1\" does not exist...exiting." | |
exit 1 | |
else | |
echo "Deploying..." | |
(cd .deploy && command cap "$1" deploy) | |
fi | |
exit 1 | |
fi | |
set -o nounset | |
set -o errexitah fai |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was just a utility script so I could execute
deploy 'environment'
without having to cd into the .deploy directory.