Use dummy API key for Travis CI

midhunhk

My Android app uses Google Payments and I store the API Keys in a values xml that is not added to VCS (used .gitignore file). I reference the value as R.string.api_licence from my code.

When I setup travis for CI, it was complaining that R.string.api_licence was not found. As a work around, I checked in a dummy text file with empty value for the key and rename the extension to xml from travis build script.

While this is working for now,
1 - This doesn't seem like a perfect solution
2 - Android Studio complains that the dummy txt file name should be of xml extension, and I have to delete it locally to work, which leads me to accidentally commit and break the builds sometimes

Travis script file: https://github.com/midhunhk/message-counter/blob/master/.travis.yml

Notes: I am a self taught Android developer. I don't require the real API keys to be used for CI process. I did some considerable research on this topic and couldn't get a specific answer to my problem.

midhunhk

I think the following approach can be used for solving this issue. I never got to test this as I changed my API implementation and may not need to store the API key in the source code.

https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Use xcodebuild (Xcode 8) and automatic signing in CI (Travis/Jenkins) environments

How to set the "api_key" value in Travis CI

How to add SSH Key in Travis CI?

use velocity, meteor, and travis ci

Is It possible to use Linux bridges on Travis-CI?

Travis CI - Enabling repository build via API

Can Travis CI use an encrypted file in different forks of the same repo?

How to properly use curl in Travis-CI config file (YAML)?

How to use recent Boost versions with Travis CI

Is it possible to use Protractor with Github/Travis CI without SauceLabs

Travis CI deploy: invalid option "--secret_access_key="

How to use environment variables in travis-ci

How to set up Travis CI to use linked (local) packages?

How to use dotnet tool during Travis-CI build?

Can I use Travis-CI with a Tkinter GUI?

Key - Error when running in Travis CI| Pytest

Escaping hyphen in yaml key value for Travis CI

restarting builds with travis ci api

travis ci npm release error "missing api_key"

How to use multiple Travis CI files inside a single repository?

Travis CI for R packages: no deploy key found

How can I make Travis CI use input() in python?

Need to View Travis CI Test Stats on Repo Pull Requests via the Travis API Calls

Is there a way to use ruby in a node environment on Travis CI?

Use ActiveMQ in Travis CI

How to use different R versions to test packages with Travis-CI?

How to Use Devicemapper Docker Filesystem Backends in Travis CI?

API request fails on Travis-CI

Travis CI - environment variable key with dot (.)