Nolan Zandi
Nolan Zandi

Reputation: 111

How do I include generic secrets/config file in github repository (for CI purposes) without deploying it to production

I'm using some APIs in my application that require API keys. I added a secrets file for my local computer with a test API key and also added a secrets file to production with the production API key. I added the secrets file to gitignore and it is not included with my github repository.

However, Travis-CI fails its build when I don't have a secrets file in the github repository because it is unable to load the environment with that file missing.

How can I include a generic secrets file with a test key in the repository to pass Travis-CI builds as well as provide guidance to other developers on the filestructure but not have that generic secrets file deploy to production?

Upvotes: 1

Views: 115

Answers (1)

languitar
languitar

Reputation: 6784

There are two methods available according to the travis documentation.

On the one hand, you can encrypt information to include in the .travis.yml as described here using public key crypto.

On the other hand, there is also a way to encrypt whole files as described here.

Upvotes: 2

Related Questions