reactjs - Bitbucket 管道无法推送到 heroku

标签 reactjs git bitbucket-pipelines

我确实有一个 react.js 应用程序 (create-react-app) 我按照官方文档中的解释设置了文件,一切顺利,但推送失败了这一特定行

git push https://heroku:$API_KEY@git.heroku.com/$APP_NAME.git HEAD:master

bitbucket-pipelines.yml 位于根文件夹中:

image: node:6
clone:
  depth: full
pipelines:
  default:
    - step:
        script:
          - npm install
          - npm test
          - git push git push https://heroku:$API_KEY@git.heroku.com/$APP_NAME.git HEAD:master

我做错了什么? 这里的目标是在 bitbucket 平台上使用 CI,但也将主提交推送到 heroku 存储库以自动部署。

我得到的错误是:

remote: !   WARNING:
remote: !   Do not authenticate with username and password using git.
remote: !   Run `heroku login` to update your credentials, then retry the git command.
remote: !   See documentation for details: https://devcenter.heroku.com/articles/git#http-git-authentication
fatal: Authentication failed for 'https://heroku

最佳答案

首先,确保你的脚本不涉及git push git push https://heroku:
应该是 git push https://heroku:...

其次,作为described here ,请确保使用您的 HEROKU_API_KEY,即 heroku authorizations --json(字段“token”)返回的那个

image: node:6
clone:
  depth: full
pipelines:
  default:
    - step:
        script:
          - npm install
          - npm test
          - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master

关于reactjs - Bitbucket 管道无法推送到 heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52789162/

相关文章:

angularjs - React 等价于 ng-repeat

javascript - React Native 怪异的 flex 行为

reactjs - React/JSX 如何指定内置 HTML 类型作为变量

git - Cherry pick 仅提交涉及特定文件的内容

javascript - 编辑方法未检索适当的信息 [错误] React

git - p4 命令行相当于 “git log -p” ?

git:在交互式 rebase 期间再次跳回

amazon-web-services - 无法通过 Bitbucket 管道的 OIDC 连接在 AWS 上获取 'branchName'

bitbucket - 我可以从 bitbucket 管道中的其他管道执行管道吗?

azure - 如何将应用程序从bitbucket部署到azure