public
Last active

BatSignal - Automate Github Deploy

  • Download Gist
batsignal.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/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."
'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.