Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get feature branch to build on master when pipeline deployment to Heroku?

GregE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 8, 2018

Say I have a feature branch `feature/my-feature` and using pipelines I want to deploy to a Heroku app called `dev-server`.

My pipelines config has the branch config:

branches:
feature/*:
- step:
name: Build feature branch and push to Heroku dev server
deployment: test
script:
- npm install
-
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME_DEV.git HEAD

When deploying, logs say:

+ git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME_DEV.git HEAD
remote: Pushed to non-master branch, skipping build.

And the app does not get built on the Heroku server.

Apparently this is because Heroku needs the app to be built on the master branch.

What should the git push command be to have the build occur on the master branch?

I tried replacing "HEAD" with "master" but the build failed with error

+ git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME_DEV.git master
error: src refspec master does not match any.

 

1 answer

1 accepted

0 votes
Answer accepted
GregE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 10, 2018

Figured it out: using HEAD:master works.

ashinzekene September 25, 2018
ashinzekene September 25, 2018

A mistake. I can't delete comments???

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events