Skip to content

Instantly share code, notes, and snippets.

@tomcardoso
Last active March 28, 2016 17:59
Show Gist options
  • Save tomcardoso/c882c9d51df9b9a33659 to your computer and use it in GitHub Desktop.
Save tomcardoso/c882c9d51df9b9a33659 to your computer and use it in GitHub Desktop.
chart tool heroku deployment
#!/bin/bash
CURRHASH=`git rev-parse --short HEAD`
CURRBRANCH=`git rev-parse --abbrev-ref HEAD`
git commit -am "Deploying ${CURRHASH} to Heroku"
git checkout -b "deploy-${CURRHASH}"
gulp lib-build
git add .
git commit -m "Updating buildpacks, removing gitignore"
git filter-branch -f --prune-empty --subdirectory-filter meteor "deploy-${CURRHASH}"
heroku addons:create mongolab:sandbox
heroku config:add MONGO_URL=$DEMO_CHARTTOL_MONGO
heroku labs:enable http-session-affinity
heroku config:add ROOT_URL=http://chart-tool-demo.herokuapp.com
heroku buildpacks:set 'https://github.com/heroku/heroku-buildpack-multi.git'
echo -n "" > .buildpacks
echo 'https://github.com/dscout/wkhtmltopdf-buildpack.git' >> .buildpacks
echo 'https://github.com/jordansissel/heroku-buildpack-meteor.git' >> .buildpacks
git add .
git commit -m "Deploying ${CURRHASH} to Heroku"
git push heroku "deploy-${CURRHASH}":master --force
git checkout ${CURRBRANCH}
git branch -D "deploy-${CURRHASH}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment