From 590fad00710ca2209ee2471d25316b8f67721d90 Mon Sep 17 00:00:00 2001 From: Stephan D Date: Fri, 7 Nov 2025 23:55:41 +0100 Subject: [PATCH] fx build fix --- ci/pipelines/fx/build.sh | 18 ++++++++++++------ ci/pipelines/fx/deploy.sh | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ci/pipelines/fx/build.sh b/ci/pipelines/fx/build.sh index 0daa259..a87867c 100755 --- a/ci/pipelines/fx/build.sh +++ b/ci/pipelines/fx/build.sh @@ -6,10 +6,14 @@ if ! set -o pipefail 2>/dev/null; then fi sh ci/pipelines/fx/ensure_env_version.sh -sed -i 's/\r$//' ./ci/prod/.env.runtime -sed -i 's/\r$//' ./.env.version +normalize_env_file() { + file="$1" + tmp="${file}.tmp.$$" + tr -d '\r' <"$file" >"$tmp" + mv "$tmp" "$file" +} -lc_load_env_file() { +load_env_file() { file="$1" while IFS= read -r line || [ -n "$line" ]; do case "$line" in @@ -20,13 +24,15 @@ lc_load_env_file() { key="$(printf '%s' "$key" | tr -d '[:space:]')" value="${value#"${value%%[![:space:]]*}"}" value="${value%"${value##*[![:space:]]}"}" - value="${value%$'\r'}" export "$key=$value" done <"$file" } -lc_load_env_file ./ci/prod/.env.runtime -lc_load_env_file ./.env.version +normalize_env_file ./ci/prod/.env.runtime +normalize_env_file ./.env.version + +load_env_file ./ci/prod/.env.runtime +load_env_file ./.env.version REGISTRY_URL="${REGISTRY_URL:?missing REGISTRY_URL}" APP_V="${APP_V:?missing APP_V}" diff --git a/ci/pipelines/fx/deploy.sh b/ci/pipelines/fx/deploy.sh index b1a95d7..afe065d 100755 --- a/ci/pipelines/fx/deploy.sh +++ b/ci/pipelines/fx/deploy.sh @@ -6,10 +6,14 @@ if ! set -o pipefail 2>/dev/null; then fi sh ci/pipelines/fx/ensure_env_version.sh -sed -i 's/\r$//' ./ci/prod/.env.runtime -sed -i 's/\r$//' ./.env.version +normalize_env_file() { + file="$1" + tmp="${file}.tmp.$$" + tr -d '\r' <"$file" >"$tmp" + mv "$tmp" "$file" +} -lc_load_env_file() { +load_env_file() { file="$1" while IFS= read -r line || [ -n "$line" ]; do case "$line" in @@ -20,13 +24,15 @@ lc_load_env_file() { key="$(printf '%s' "$key" | tr -d '[:space:]')" value="${value#"${value%%[![:space:]]*}"}" value="${value%"${value##*[![:space:]]}"}" - value="${value%$'\r'}" export "$key=$value" done <"$file" } -lc_load_env_file ./ci/prod/.env.runtime -lc_load_env_file ./.env.version +normalize_env_file ./ci/prod/.env.runtime +normalize_env_file ./.env.version + +load_env_file ./ci/prod/.env.runtime +load_env_file ./.env.version FX_MONGO_SECRET_PATH="${FX_MONGO_SECRET_PATH:?missing FX_MONGO_SECRET_PATH}" FX_DEPLOY_TARGET="${FX_DEPLOY_TARGET:?missing FX_DEPLOY_TARGET}"