Skip to content

Instantly share code, notes, and snippets.

@raymcdermott
Created March 30, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raymcdermott/c961c3dd37d425af9c35 to your computer and use it in GitHub Desktop.
Save raymcdermott/c961c3dd37d425af9c35 to your computer and use it in GitHub Desktop.
Run a deployment from Bamboo to Heroku with independence from locally installed tools
#!/usr/bin/env bash
############ CONFIGURE GIT from this repo
git config user.email "bamboo@company.com"
git config user.name "Bamboo Dev"
# Add a remote master to Heroku (if one does not exist)
(git remote -v | grep "^heroku" > /dev/null) ||
heroku git:remote --app $HEROKU_APP_NAME --org $HEROKU_ORG_NAME
############ LOCAL INSTALL of node build pipeline tools
# use npm to install the latest npm in this repo
npm install npm
# use the new npm to install other tools for this repo
alias npm="node $PWD/node_modules/npm/bin/npm-cli.js"
# install react tools
npm install react-tools
########### RUN BUILD PIPELINE
PATH=node_modules/react-tools/bin:$PATH
reactSrcDirectory=react-src
reactOutputDirectory=public/sso
jsx ${reactSrcDirectory} ${reactOutputDirectory}
# Use --force to override the usual .gitignore rule
git add --all --force ${reactOutputDirectory}
git commit -a -m bamboo-build
########### PUSH TO HEROKU
git push --force heroku master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment