Skip to content

Instantly share code, notes, and snippets.

@minikin
Last active August 17, 2020 10:21
Show Gist options
  • Save minikin/0f41867c508967927c61b1b765a84120 to your computer and use it in GitHub Desktop.
Save minikin/0f41867c508967927c61b1b765a84120 to your computer and use it in GitHub Desktop.
#!/bin/sh
CURRENT_DIR="$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")"
echo "$CURRENT_DIR"
# Decrypt and Configure Local Environment
# --yes to assume "yes" for questions
function configure_local_environment() {
gpg --yes --decrypt --no-symkey-cache \
--output $CURRENT_DIR/lib/configurations/secrets.dart $CURRENT_DIR/secrets/secrets.dart.gpg
}
# Decrypt and Configure CI Environment
# --batch to prevent interactive command
# --yes to assume "yes" for questions
function configure_ci_environment() {
gpg --quiet --batch --yes --decrypt --passphrase="$HVN_FLUTTER_APP_SECRET_PASSPHRASE" \
--output $CURRENT_DIR/lib/configurations/secrets.dart $CURRENT_DIR/secrets/secrets.dart.gpg
}
if [ -z "$HVN_FLUTTER_APP_SECRET_PASSPHRASE"];
then
echo Decrypting secrets for local environment
configure_local_environment
else
configure_ci_environment
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment