Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have Heroku build my development branch on a staging server?

I have a production application on master branch running all fine on heroku. I would like to run a second Heroku application but 'fed' from a local staging branch. These are the commands that i've run in my failed attempt to do this:

git checkout -b develop
heroku create --remote staging
git push staging develop

But because i'm pushing from a 'non master' branch it doesn't build the app;

remote: Pushed to non-master branch, skipping build.

I have read the managing multiple environments doc here; https://devcenter.heroku.com/articles/multiple-environments but it does not seem to address what I'm trying to achieve, rather merging develop branch into master first then pushing master to remote staging. I want to push my develop branch to a staging app and have it running live in RAILS_ENV=production mode, iteratively push to this live 'staging/testing' app then when i'm really comfy with what i'm going i'll merge the develop branch code into the master branch and push to the primary mast app.

Can anyone help me with how to achieve this?

like image 926
jbk Avatar asked Jun 07 '15 20:06

jbk


2 Answers

as per heroku doc

git push staging develop:master

like image 170
Vijay Meena Avatar answered Nov 15 '22 02:11

Vijay Meena


as per Git documentaion

git push  <REMOTENAME> <LOCALBRANCHNAME>:<REMOTEBRANCHNAME>

so

git push heroku staging:master

means

push my staging local branch to master remote heroku branch
like image 45
Bastien Vandamme Avatar answered Nov 15 '22 04:11

Bastien Vandamme