Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created January 5, 2009 02:25
Show Gist options
  • Save vangberg/43233 to your computer and use it in GitHub Desktop.
Save vangberg/43233 to your computer and use it in GitHub Desktop.
# the lil' deployment script
APP_PATH = '/var/webapps/ltt'
APP_REPO = '/home/harry/git/ltt.git'
APP_SERVER = 'ak'
def ssh(command)
`ssh #{APP_SERVER} sh -c '#{command.inspect}'`
end
desc 'deploy!'
task :deploy do
ssh "cd #{APP_PATH} && git fetch origin && git reset --hard master"
ssh "touch #{APP_PATH}/tmp/restart.txt"
end
namespace :deploy do
desc 'make directory and clone'
task :setup do
ssh "git clone #{APP_REPO} #{APP_PATH}"
ssh "cd #{APP_PATH} && test ! -d tmp && mkdir tmp"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment