Skip to content

Commit

Permalink
Merge pull request #52 from tintinnabulate/travis_encrypt
Browse files Browse the repository at this point in the history
Encrypt fanjoula.json, decrypt on Travis CI #36

This patch allows the client secret for the live staging website (Google Cloud Platform) to be accessed by Travis CI for real end-to-end integration testing of the datastore.

We do this by encrypting the client secret, adding to GitHub, and decrypting it on Travis CI.

Thanks goes to this tutorial:

https://dev.to/mmphego/how-to-encrypt-multiple-files-with-travis-ci-5a15

    .gitignore
    Update to ignore unencrypted client secret

    .travis.yml
    Decrypt client secret, untar (Autogenerated with ruby gem travis)

    fanjoula.json
    Revoke this client secret for live staging site

    secrets.tar.enc
    Add client secret
  • Loading branch information
tintinnabulate authored Jul 9, 2020
2 parents 74c6009 + 874bce6 commit 282e918
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ config.json.2021
# Other config files
eurypaa2021.json
eurypaa2020.json
#fanjoula.json
fanjoula.json

# Secrets
secrets.tar
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
language: go

go:
- 1.12.x

- 1.12.x
env:
- GO111MODULE=on

- GO111MODULE=on
before_install:
- openssl aes-256-cbc -K $encrypted_3b9f0b9d36d1_key -iv $encrypted_3b9f0b9d36d1_iv
-in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
install:
- mkdir /tmp/sdk
- curl -o /tmp/sdk.tar.gz "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-258.0.0-linux-x86_64.tar.gz"
- tar xzf /tmp/sdk.tar.gz -C /tmp/sdk
- export PATH="$PATH:/tmp/sdk/bin"
- go mod download

- mkdir /tmp/sdk
- curl -o /tmp/sdk.tar.gz "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-258.0.0-linux-x86_64.tar.gz"
- tar xzf /tmp/sdk.tar.gz -C /tmp/sdk
- export PATH="$PATH:/tmp/sdk/bin"
- go mod download
script:
- make test
- make test
12 changes: 0 additions & 12 deletions fanjoula.json

This file was deleted.

Binary file added secrets.tar.enc
Binary file not shown.

0 comments on commit 282e918

Please sign in to comment.