Last active
September 28, 2021 04:46
-
-
Save ts-ign0re/6c86297070517991e744c0eeada24c53 to your computer and use it in GitHub Desktop.
Write env variables from Appcenter with secrets into .env file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all variables and write to .env | |
ENV_WHITELIST=${ENV_WHITELIST:-"^"} | |
printf "Creating an .env file with the following whitelist:\n" | |
printf "%s\n\n" $ENV_WHITELIST | |
set | egrep -e $ENV_WHITELIST | egrep -v "^_" | egrep -v "WHITELIST" > .env | |
printf "\n.env created with contents:\n" | |
cat .env | |
# copy firebase config files | |
if [[ "$APPCENTER_BRANCH" == "master" || "$APPCENTER_BRANCH" =~ 'release' ]]; | |
then | |
cp -fr ./configuration/production/GoogleService-Info.plist ./ios | |
cp -fr ./configuration/production/google-services.json ./android/app | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment