【问题标题】:Unable to push to unqualified destination: master while deploying to demo branch无法推送到不合格的目的地:部署到演示分支时的主控
【发布时间】:2015-07-22 10:18:35
【问题描述】:

我正在尝试为我的应用程序创建一个演示分支,供应商可以在其中登录以了解有关其功能的更多信息。

我有一个在 Heroku 上部署到生产环境的 master 分支。此外,我有一个部署到我的 Heroku 暂存环境的暂存分支。在 Github 应用程序中,我从暂存分支创建了一个名为“demo”的分支。

当我使用 CircleCI 进行部署时,我收到以下错误:

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

我的 circle.yml 如下所示:

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

暂存的部署流程运行良好,唯一的问题是我的新演示分支。我尝试删除分支和 Heroku 应用程序(foobar-demo.herokuapp.com),但没有任何运气。

【问题讨论】:

    标签: git heroku circleci


    【解决方案1】:

    我在这个SO thread 接受的答案中找到了解决方案。

    我必须在我的 circle.yml 文件中将 $CIRCLE_SHA1:master 更改为 $CIRCLE_SHA1:refs/heads/master

    【讨论】:

      猜你喜欢
      • 2016-07-12
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 2020-08-07
      • 2015-04-09
      • 2016-12-13
      • 1970-01-01
      • 2013-06-03
      相关资源
      最近更新 更多