通过 Travis-CI 部署到 Heroku 的问题

And*_*lla 9 heroku travis-ci

在使用 Heroku 进行部署时,我不断收到此错误,并且在通过 Travis 运行构建后尝试将其部署到 Heroku 的几个不同报告中得到了它。

No stash entries found.
API request failed.
Message: Invalid credentials provided.
Reference: 
failed to deploy
Run Code Online (Sandbox Code Playgroud)

我没有得到更多信息。我尝试更新我的 Heroku API 密钥,但这似乎不起作用。我已经使用了该Travis setup Heroku命令并手动创建了构建步骤,但我仍然遇到相同的错误。这是我的 .travis.yml 文件的部署部分的样子

部署:提供者:heroku api_key:安全:g3gj25vI58r48P63E...应用程序:heroku-travis-test-01 on:repo:andrico1234/heroku-travis-test

这是一个常见的问题吗?

编辑:添加 Travis 的安装依赖项堆栈跟踪

2.71s$ rvm $(travis_internal_ruby) --fuzzy do ruby -S gem install dpl
Fetching: dpl-1.10.0.gem (100%)
Successfully installed dpl-1.10.0
1 gem installed
dpl.1
Installing deploy dependencies
Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.15.2.gem (100%)
Successfully installed faraday-0.15.2
Fetching: rendezvous-0.1.2.gem (100%)
Successfully installed rendezvous-0.1.2
Fetching: netrc-0.11.0.gem (100%)
Successfully installed netrc-0.11.0
Fetching: dpl-heroku-1.10.0.gem (100%)
Successfully installed dpl-heroku-1.10.0
5 gems installed
Run Code Online (Sandbox Code Playgroud)

小智 12

出于某种原因heroku auth:token,即使在确保我在命令行上登录到 heroku 之后,也为我返回了错误的令牌。

在尝试了所有发布的解决方案后,对我有用的是:

  • 转到Heroku 帐户
  • 手动复制 API 密钥,然后将其粘贴到命令行中:
    • 对于托管在travis-ci.com 上的那些:
    • travis encrypt pasteAPIKeyHere --add deploy.api_key --pro
    • 对于托管在travis-ci.org的那些:
    • travis encrypt pasteAPIKeyHere --add deploy.api_key --org

希望这可以帮助。


fre*_*zed 2

这是一个加密问题,具体取决于您的 Travis 帐户的托管位置(travis-ci.comtravis-ci.org)以及您的项目是否公开。

我使用连接的公共项目,并且Travis-ci 文档给出的有关部署到 Heroku 的travis-ci.com命令不起作用: travis encrypt $(heroku auth:token) --add deploy.api_key

为了保证正确的加密,在我的例子中使用--org(for travis-ci.org) 或--pro(for ) 标签:travis-ci.com

travis encrypt $(heroku auth:token) --add deploy.api_key --pro

请参阅Travis-CI 问题 #10018