From dbb4b52a70100d0c9fde5615ee1e43446a4cc96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Sun, 21 Jun 2020 11:18:59 +0200 Subject: [PATCH] nix: make secretsFile argument optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- scripts/release-android.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/release-android.sh b/scripts/release-android.sh index 85cd59ee34..76961f2ae1 100755 --- a/scripts/release-android.sh +++ b/scripts/release-android.sh @@ -37,14 +37,19 @@ config+="status-im.android.abi-split=\"$(must_get_env ANDROID_ABI_SPLIT)\";" config+="status-im.android.abi-include=\"$(must_get_env ANDROID_ABI_INCLUDE)\";" nixOpts=() -# Secrets like this can't be passed via args or they end up in derivation -SECRETS_FILE_PATH=$(mktemp) -chmod 644 ${SECRETS_FILE_PATH} -trap "rm -f ${SECRETS_FILE_PATH}" EXIT -append_env_export 'KEYSTORE_PASSWORD' -append_env_export 'KEYSTORE_ALIAS' -append_env_export 'KEYSTORE_KEY_PASSWORD' -nixOpts+=("--argstr" "secretsFile" "${SECRETS_FILE_PATH}") +# If no secrets were passed there's no need to pass the 'secretsFile' +if [[ -n "${KEYSTORE_ALIAS}${KEYSTORE_ALIAS}${KEYSTORE_ALIAS}" ]]; then + # Secrets like this can't be passed via args or they end up in derivation + SECRETS_FILE_PATH=$(mktemp) + trap "rm -f ${SECRETS_FILE_PATH}" EXIT ERR INT QUIT + chmod 644 ${SECRETS_FILE_PATH} + append_env_export 'KEYSTORE_PASSWORD' + append_env_export 'KEYSTORE_ALIAS' + append_env_export 'KEYSTORE_KEY_PASSWORD' + nixOpts+=("--argstr" "secretsFile" "${SECRETS_FILE_PATH}") +fi + +# Used by Clojure at compile time to include JS modules nixOpts+=("--argstr" "buildEnv" "$(must_get_env BUILD_ENV)") if [[ "$(uname -s)" =~ Darwin ]]; then