I encrypted my .env file, and I now have a .env.enc
file. How does my team decrypt this?
I got this response when I encrypted the file, and it is stored in my .
Check the output of travis encrypt-file
!
Especially the first line:
encrypting <filename> for <repository name>
[..]
You need to be in the correct repo (and use --com
if needed) to be sure that Travis will find the generated values it later needs.
Your file is probably decrypted somewhere during the build on Travis. It might be easiest to add a deploy
step to the build, so the .env
file is uploaded to a place where you can download it yourself.
For details on how to deploy files, check this link or this one specifically for github
Here's a short sample of what I did ;)
in .travis.yml
before_install:
// Somewhere your files are being decrypted
openssl aes-256-cbc -K $encrypted_cf94abc85bdc_key -iv $encrypted_cf94abc85bdc_iv -in .env.enc -out .env -d
// Add a deploy step, which allows you which files to upload
deploy:
file:
- .env /* add the file here, so it will be pushed to github */
api_key: $apikey
on:
repo: <your github repo>