Skip to content

Instantly share code, notes, and snippets.

@justinholmes
Created June 5, 2012 21:00
Show Gist options
  • Save justinholmes/2877870 to your computer and use it in GitHub Desktop.
Save justinholmes/2877870 to your computer and use it in GitHub Desktop.
Git hook for PlayFramework 2.0 apps to deploy to a remote server
#!/bin/sh
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
path="path to application"
User="userforssh"
server="servername"
dist="/Users/justin/Apps/Play20/play dist"
filename="application.zip"
script(){
echo "Deploying to remote server"
echo "From directory $(pwd)"
cd $path
echo $pwd
$dist
echo $path/dist/$filename
cd "dist"
scp $filename $server:
ssh $User@$server ./deploy.sh
exit
}
case "$1" in
*)
script
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment