我确实有一个 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/