I have .travis.yml
with some secure (encrypted) env variables. Now I need to descrypt those variables to use them in different project.
Is there easy way of doing this (except triggering a commit and printing them in console output)?
The travis encrypt-file command will encrypt a file for you using a symmetric encryption (AES-256), and it will store the secret in a secure variable. It will output the command you can use in your build script to decrypt the file. Make sure to add super_secret.
Encryption scheme # Travis CI uses asymmetric cryptography. For each registered repository, Travis CI generates an RSA keypair. Travis CI keeps the private key private, but makes the repository's public key available to those who have access to the repository.
TRAVIS_BRANCH : for push builds, or builds not triggered by a pull request, this is the name of the branch. for builds triggered by a pull request this is the name of the branch targeted by the pull request. for builds triggered by a tag, this is the same as the name of the tag ( TRAVIS_TAG ).
You can't decrypt locally from what I understand but you can recover the key/values. By nature, they have to be decrypted to be used during the build process.
***********@to2.tmate.io
env
.This will print all of the environment variables so you will have to dig a little for your secure ones but they will be there.
I don't think you can decrypt it. Public key is used to encrypt the data and it can only be decrypted with the private key which travis doesn't provide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With