在 travis.yml 中使用加密的 bintray 密钥的问题 [英] Issue using Encrypted bintray key in travis.yml
问题描述
因此,当我在 .travis.yml 中使用以下内容时,它会起作用..
*********************
deploy:
user: mybintrayuserid
provider: bintray
file: .bintray_descriptor.yml
key: myapikey
***********************
但如果我将其更改为以下内容,则会出现错误:
**************************
deploy:
user: mybintrayuserid
provider: bintray
file: .bintray_descriptor.yml
key:
secure: encryptedHashHash
****************************
我得到的错误:
[Bintray Upload] Bintray 响应:401 未经授权.此资源需要身份验证.
[Bintray Upload] Bintray response: 401 Unauthorized. This resource requires authentication .
我是如何生成密钥的:
travis encrypt myapikey --add deploy.key
注意:我也添加了屏幕截图以获取更多详细信息..
Note: I've added screenshot too for more details ..
截图:http://i.stack.imgur.com/rhkgJ.png
推荐答案
请确保您也使用正确的用户.
Make sure you use the correct user also.
就我而言,我试图部署到组织拥有的存储库,但我错误地将 user
配置为组织名称.
In my case, I was trying to deploy to a repo owned by an organization, and I wrongly configured the user
as the organization name.
您必须使用与 API 密钥关联的用户名,而不是在您的 .travis.yml
中使用组织作为 user
.
Instead of using the organization as the user
in your .travis.yml
you must use your the username associated with the API key.
我对用户和密钥都进行了加密 - 并且可以正常工作.
I have both the user and the key encrypted - and working.
这篇关于在 travis.yml 中使用加密的 bintray 密钥的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!