Created
August 8, 2012 22:48
-
-
Save srcoley/3299526 to your computer and use it in GitHub Desktop.
BatSignal - Automate Github Deploy
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/bash | |
# Author: Stephen Coley @coleydotco | |
# | |
# This script automates a Github deploy. | |
# I use it with Alfred to deploy http://coley.co. | |
# | |
# Change the stuff surrounded in [..] | |
# | |
# You must run git pull in the terminal and | |
# copy the line that asks you for your password. | |
# Replace [Enter passphrase for key \\'~/.ssh/id_rsa\\':] with what you copied | |
# Make sure to put a \\ before any single quote to escape the character | |
# | |
# Fork and improve! | |
expect -c ' | |
spawn ssh [user]@[domain] ; | |
expect "password" ; | |
send "[your password]\n" ; | |
send "cd [/to/your/repo]\n" ; | |
send "git pull\n" ; | |
expect "[Enter passphrase for key \\'~/.ssh/id_rsa\\':]" ; | |
send "[your password]\n" ; | |
expect "Already up-to-date." | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment