在我的Travis CI企业设置中,当我使用Travis CLI加密密码时,它抱怨我没有登录,尽管我之前成功登录。
$ travis login -e https://travis-ci.my-company.corp/api
We need your GitHub login to identify you.
This information will not be sent to Travis CI, only to github.my-company.corp.
The password will not be displayed.
Try running with --github-token or --auto if you don't want to enter your password anyway.
Username: itsme
Password for itsme: ********
Successfully logged in as itsme!
$ travis encrypt
not logged in, please run travis login --pro
为 Travis CLI 设置默认端点为我解决了这个问题:
travis endpoint --set-default --api-endpoint https://travis-ci.my-company.corp/api
travis login
travis encrypt "escaped_password" --add deploy.password
当您在这里时,作为旁注:使用 travis encrypt
时,请记住对密码中的特殊字符进行转义,因为它们将由构建环境中的bash
进行评估......