GoogleCloudPlatform / google-cloud-gemserver

CLI to deploy a private gem server to Google App Engine Flex
Apache License 2.0
46 stars 14 forks source link

Fix travis #29

Closed arhamahmed closed 7 years ago

arhamahmed commented 7 years ago

Fixes #22

Unit tests can run with and without GOOGLE_APPLICATION_CREDENTIALS set or any other environment variable. However, after PR merges tests are run with that variable set prior to the decryption of the service account key file it points to. As a workaround, that environment variable is temporarily unset for unit tests so both PR builds and master branch builds run.

The travis encrypt-file method kept failing with a cryptic error so secret encryption/decryption is now done manually. Symmetric file encryption is used via openssl with the key stored in GEMSERVER_ENCRYPTION_KEY:

echo -n "$GEMSERVER_ENCRYPTION_KEY" | openssl enc -aes-256-cbc -salt -in secrets/app.yaml -out secrets/app.yaml.enc -pass stdin