我已经建立了一个简单的nodejs应用程序,当我推送到github时,我想让它自动部署到Heroku。 这是我的shippable.yml文件:
language: node_js
node_js:
- 0.10.33
build:
ci:
- echo 'CI running'
on_success:
- git push https://git.heroku.com/cicddemo123.git master
这是我的.netrc文件:
machine api.heroku.com
login fasching.ryan@gmail.com
password 9dr2frg5-afbg-lk01-ma90-89b69c09d53a
machine git.heroku.com
login ryryfasch
password 9dr2frg5-afbg-lk01-ma90-89b69c09d53a
该密码不是真实的密码,我只是添加了一个占位符,但是我使用heroku auth:token
来获取所使用的密码。
这是我对github进行提交时在Shippable中遇到的错误:
git push https://git.heroku.com/cicddemo123.git master
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://git.heroku.com/cicddemo123.git/'
当我运行git remote -v
时,我得到的是:
origin https://github.com/ryryfasch/CI-CD-tutorial.git (fetch)
origin https://github.com/ryryfasch/CI-CD-tutorial.git (push)
我在Ubuntu 18.04操作系统上。如何解决此错误?我是否需要在.netrc文件中添加其他内容?我被困住了,任何帮助都会很棒。
我已经尝试过这些堆栈溢出问题,以寻求帮助,但仍然无法正常工作:
'git push heroku master' is still asking for authentication
How to deploy a website on Heroku?
"Git Push Heroku Master" - Cannot login to heroku - Cloud9 IDE