Hello
I have a production and a staging app (nodejs) on Heroku. I want to create a pipeline on bitbucket so that when I push code to staging it deploys staging branch to my staging app on Heroku and master to production app?
Regards
Matloob
Hi,
Have a look at the following guide we have here: https://confluence.atlassian.com/bitbucket/deploy-to-heroku-872013667.html
The only thing you'll need to do different is set up the branch configurations. Which you can learn about here: https://confluence.atlassian.com/bitbucket/branch-workflows-856697482.html
image: node:6clone: depth: fullpipelines: branches: master: - step: name: Deploy to production script: - npm install - npm test - git push <heroku production URL> staging: - step: name: Deploy to staging script: - npm install - npm test - git push <heroku staging URL>
Thanks,
Phil
Hi Phil
Thanks for taking the time to reply. I had found this page (https://confluence.atlassian.com/bitbucket/branch-workflows-856697482.html) too. My .yml file looks like:
image: node:8.9.2clone: depth: fullpipelines: default: - step: name: Deploy REST API to Heroku deployment: production script: - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD branches: graphql: - step: name: Deploy GraphQL to Heroku deployment: staging script: - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME_STAGING.git graphql:master
But it never pushes from the branch graphql. What's wrong with the configuration?
Do you mean that the build never triggers on the 'graphql' branch, or that the git push command fails. Do you get an error message?
The push goes through to Bitbucket, but the deployment does not run for graphql.
It looks like you're new here. Sign in or register to get started.