The Command Line Client overrides encrypted entries if you use it to encrypt multiple files. If you need to encrypt multiple files, first create an archive of sensitive files, then decrypt and expand it during the build.
$ make encrypt FILE_NAME=sensitive-data.json
test -n "sensitive-data.json" && ls sensitive-data.json >/dev/null
cp sensitive-data.json tmp-1pBHxolDaS
cd tmp-1pBHxolDaS && travis encrypt-file sensitive-data.json
encrypting sensitive-data.json for pinkumohikan/some-repository
storing result as sensitive-data.json.enc
storing secure env variables for decryption
Please add the following to your build script (before_install stage in your .travis.yml, for instance):
openssl aes-256-cbc -K $encrypted_xxx_key -iv $encrypted_xxx_iv -in sensitive-data.json.enc -out sensitive-data.json -d
Pro Tip: You can add it automatically by running with --add.
Make sure to add sensitive-data.json.enc to the git repository.
Make sure not to add sensitive-data.json to the git repository.
Commit all changes to your .travis.yml.
cp tmp-1pBHxolDaS/*.enc .
rm -rf tmp-1pBHxolDaS
Note: It is important to list PHP extensions your project requires. Not all PHP installations are created equal: some may miss extensions you may consider as standard (such as ext-mysqli which is not installed by default in Fedora/CentOS minimal installation systems). Failure to list required PHP extensions may lead to a bad user experience: Composer will install your package without any errors but it will then fail at run-time. The composer show --platform command lists all PHP extensions available on your system. You may use it to help you compile the list of extensions you use and require. Alternatively you may use third party tools to analyze your project for the list of extensions used.