I'm trying to use some encrypted vars with travis-ci.com and they are not decoding properly when travis executes a build from a commit. You can see when it does the export it's just a gibberish VAR.
The Setup:
- Running on Ubuntu: buster/sid
- I've installed ruby-full
- I've gem installed travis: 1.8.8
- I've pulled my repo and I'm doing the encryption commands in the folder with .travis.yml
- It asked me to verify it had the proper repo the first time I ran the encrypt command.
- I expect I'm getting the proper public key, but it sure doesn't look like it.
- This is all happening in a docker container.
- I'm committing to master. No pull request.
Other things I've tried or screwed up already:
- Single quotes around the var.
- Multiple vars or missing dash. Having multiple vars changes the format slightly in that they have a "-" in front of secure. The line would then look like:
- secure INXfNQealZn84xzQ6M0g...
- Ran the encryption in the wrong repo folder.
Commands used to generate MYVAR:
root@31ee1eba15d3:~/tigelane/stuff# travis encrypt MYVAR="somestuff" --add env.global
root@31ee1eba15d3:~/tigelane/stuff# tail -3 .travis.yml
env:
global:
secure: INXfNQealZn84xzQ6M0gyhqPOeF1GhOZ8g7V6bqqqZbbgPsW1eOUntJOMo/uilvG8j6BbV3SW8kiDjmH4TjrTCKJ4hevzunoKumXXGpiYQNj74LsCPgyiohebyWgf4cP/F71ay6vHzghfGYAnu2svBMHKIFTj8s8aOCVDIo/ntsmkeeRVfOMMMNFbNQEHTqSw0981xYdrMVrISFw/BgEHia0PQn7Ll9YUN0/lQ9AFamyrflfp8dS3toP0fZiPnfgxIaENXS1wsQkCheday6quyAG8j6LE9YUHLq4Yzv5ZyRp/aOivugc8MKA+qAcFGpwhrcAGz5Rbo9lNXFnrcF93mqBs2FO0OLOWExjBryPH5shO/YWGNYWDX8cykOC4+AXmlUMcsgIHihKXSHB0E5Qo+dFyVKKSeLfpLOVHg+utf1thm9pxhW2DGynqCktHS26Bnfhr5Hay2CCYrv+eI8E5sv8ZzqRPDNdtuCsIxO1+UCVfavp9BDW3YxtZg44TNR+fA258SFa7KZtJtG95kOPNwWnBJQiITuu85OjY36pCwsJX0vq883RAOA/jIdNn+eYsyvyHi5cfQGUPD3HGLh9+zN+LQURXHrYu6tfjPjcIk83c37MtGEfmYcwgLzAxYL61SXJbr0IIEVc1x3+sqI72mUtHwsyUxmgpoGVoyZcJrg=
Output I get in the Travis Job log:
Setting environment variables from .travis.yml
$ export sqI72mUtHwsyUxmgpoGVoyZcJrg=[secure]
Output I expected in the Travis Job log:
Setting environment variables from .travis.yml
$ export MYVAR=[secure]
You've forgotten a dash:
See https://docs.travis-ci.com/user/environment-variables/#defining-encrypted-variables-in-travisyml