google / secrets-gradle-plugin

A Gradle plugin for providing your secrets to your Android project.
Apache License 2.0
1.13k stars 99 forks source link

CI/CD system doesn't resolve environment variables #65

Open MaxMichel2 opened 1 year ago

MaxMichel2 commented 1 year ago

Using this plugin, I am able to easily keep my API keys locally and not upload them via git.

However, when using the Gitlab CI system to deliver application via runners, this plugin doesn't resolve the keys in environment variables defined in Gitlab (ORG_GRADLEPROJECT) and defaults to using the default variables in the specified file (local.defaults.properties for example).

The expected behaviour is:

fedesenmartin commented 1 year ago

I use bitriss(no idea for gitlab ci) and creating a script that creates and fills local.properties file worked for me

The script:

#!/usr/bin/env bash
cat > "./local.properties" <<- FILE_CONTENT
SECRET_VARIABLE1=value1
SECRET_VARIABLE2=value2
FILE_CONTENT

note that the values should be stored in secrets variables in github/bitrise