Skip to content

Instantly share code, notes, and snippets.

@alexcurtis
Created January 27, 2013 13:50
Show Gist options
  • Save alexcurtis/4648407 to your computer and use it in GitHub Desktop.
Save alexcurtis/4648407 to your computer and use it in GitHub Desktop.
Heroku versioning on a Node.js project with Jade.
#!/bin/bash
#Update Version Number
version=$((`heroku releases | sed -n 2p | awk '{print substr($1,2); }'` + 1))
echo Updating JADE Version Number...
sed "s/'.*'/'$version'/" ./views/version.jade > version.tmp
mv version.tmp ./views/version.jade
#Deploy
echo Deploying Version: $version
git commit -a -m 'Deployment Build'
#GitHub
echo Deploying To Github...
git push origin master
#Heroku
echo Deploying To Heroku...
git push heroku master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment