Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 1.67 KB

README.md

File metadata and controls

44 lines (37 loc) · 1.67 KB

travis-encrypt-cli

Command-line Unix script to encrypt sensitive information in Travis CI .travis.yml files.

Dependencies

There is no need to have Ruby and Travis CLI installed. With this script you only need:

  • curl to download RSA public key from Travis repo API
  • OpenSSL with RSA support to encrypt text
  • Bash to run script

Usage

echo -n 'your_api_key' | ./encrypt_for_travis.bash user/repo
echo -n 'variable=value' | ./encrypt_for_travis.bash user/repo

You must use echo -n to not add newline character at the end of the encoded string. For the same reason you cannot use here strings like:

<<<'variable=value' ./encrypt_for_travis.bash user/repo

If you need proxy to access Travis website you should define HTTPS_PROXY environment variable for curl globally or per request:

echo -n 'variable=value' | HTTPS_PROXY='10.0.1.7:8080' ./encrypt_for_travis.bash user/repo

Alternatives