Created
May 26, 2010 14:52
-
-
Save kenzie/414585 to your computer and use it in GitHub Desktop.
Basic git deploy script
This file contains hidden or 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
require 'rubygems' | |
require 'net/ssh' | |
# VERSION 0.2 | |
# 0.2 – 2010/05/26 : added cleanup (rm deploy) | |
# 0.1 – 2010/05/21 : initial setup | |
HOST = "domain.com" | |
USER = "username" | |
PASSWORD = nil | |
PATH = "/var/www/path/to/html" | |
REMOTE = "origin" | |
puts "\033[1mAttempting to git push to remote #{REMOTE}...\033[0m" | |
%x{git push #{REMOTE}} | |
Net::SSH.start(HOST, USER) do |ssh| | |
puts "\033[1mAttempting to git pull on #{HOST} in #{PATH}...\033[0m" | |
ssh.exec "cd #{PATH}; git pull; rm deploy.rb" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment