简体   繁体   中英

Store secrets in Travis, not in github repo

I use this guide for ci, bumpversion, upload to pypi:

https://github.com/guettli/github-travis-bumpversion-pypi

I like it, except that the secret gets stored in the repo.

Example: https://github.com/guettli/reprec the file secret-files.tar.enc is in the git repo and it looks strange.

Open source lovers don't like unparsable binaries like this.

Is there a way to store the secret in travis instead of github?

Yes. You can set your secret as an environment variable on Travis, and use it in your program. Others can only know "oh, this guy uses a environment variable called PASSWORD !" and they don't know what the value is.

Only you and Travis CI know.

See this doc: https://docs.travis-ci.com/user/environment-variables/

If you want to store a secret file, you can create a private github repo, and clone it with your github password stored in the env variables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM