1

I'm trying to create a demo branch for my application where suppliers can login to learn more about what it does.

I have a master branch that deploys to production on Heroku. Additionally, I have a staging branch that deploys to my Heroku staging environment. In the Github App I created a branch off of the staging branch called 'demo'.

When I deploy using CircleCI, I receive the following error:

unable to push to unqualified destination: master
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.

git push git@heroku.com:foobar-demo.git $CIRCLE_SHA1:master returned exit code 1

error: failed to push some refs to 'git@heroku.com:foobar-demo.git' Action failed: git push git@heroku.com:foobar-demo.git $CIRCLE_SHA1:master

My circle.yml looks like the following:

deployment:
  staging:
    branch: staging
    commands:
      - heroku maintenance:on --app foobar-staging
      #- heroku scale worker=0 --app foobar-staging
      - git push git@heroku.com:foobar-staging.git $CIRCLE_SHA1:master
      - heroku run rake db:migrate --app foobar-staging
      #- heroku scale worker=x --app foobar-staging
      - heroku maintenance:off --app foobar-staging

  demo:
    branch: demo
    commands:
      - heroku maintenance:on --app foobar-demo
      #- heroku scale worker=0 --app foobar-demo
      - git push git@heroku.com:lfoobar-demo.git $CIRCLE_SHA1:master
      - heroku run rake db:migrate --app foobar-demo
      #- heroku scale worker=x --app foobar-demo
      - heroku maintenance:off --app foobar-demo

The deployment flow to staging is working fine, the only issue is with my new demo branch. I tried deleting the branch and Heroku app (foobar-demo.herokuapp.com) and haven't had any luck.

Questifer
  • 1,113
  • 3
  • 18
  • 48

1 Answers1

5

I found the solution in the accepted answer in this SO thread.

I had to change $CIRCLE_SHA1:master to $CIRCLE_SHA1:refs/heads/master in my circle.yml file.

fqxp
  • 7,680
  • 3
  • 24
  • 41
Questifer
  • 1,113
  • 3
  • 18
  • 48