build fix
Some checks failed
ci/woodpecker/push/fx/1 Pipeline failed
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/fx/2 Pipeline failed
ci/woodpecker/push/nats Pipeline was successful

This commit is contained in:
Stephan D
2025-11-07 20:37:46 +01:00
parent 2e23e647f8
commit 6598ce5d3a
2 changed files with 9 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ steps:
depends_on: [ secrets ]
commands:
- set -euo pipefail 2>/dev/null || set -eu
- bash ci/pipelines/fx/ensure_env_version.sh
- sh ci/pipelines/fx/ensure_env_version.sh
- sed -i 's/\r$//' ./ci/prod/.env.runtime
- sed -i 's/\r$//' ./.env.version
- set -a

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
#!/bin/sh
set -eu
regen_env_version() {
echo "[fx-pipeline] regenerating .env.version defaults" >&2
local git_rev branch app_v build_date build_user
if [[ -n "${WOODPECKER_COMMIT:-}" ]]; then
if [ -n "${WOODPECKER_COMMIT:-}" ]; then
git_rev="$(printf '%s' "${WOODPECKER_COMMIT}" | cut -c1-7)"
elif command -v git >/dev/null 2>&1; then
git_rev="$(git rev-parse --short HEAD 2>/dev/null || echo dev)"
@@ -12,7 +12,7 @@ regen_env_version() {
git_rev="dev"
fi
if [[ -n "${WOODPECKER_BRANCH:-}" ]]; then
if [ -n "${WOODPECKER_BRANCH:-}" ]; then
branch="${WOODPECKER_BRANCH}"
elif command -v git >/dev/null 2>&1; then
branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo local)"
@@ -20,7 +20,7 @@ regen_env_version() {
branch="local"
fi
if [[ -f version ]]; then
if [ -f version ]; then
app_v="$(cat version 2>/dev/null || echo dev)"
else
app_v="dev"
@@ -34,12 +34,11 @@ regen_env_version() {
}
ensure_env_version() {
if [[ ! -s ./.env.version ]]; then
if [ ! -s ./.env.version ]; then
regen_env_version
return
fi
local tmp
tmp="$(mktemp)"
if ! grep -E '^[[:space:]]*[A-Za-z_][A-Za-z0-9_]*=' ./.env.version >"$tmp"; then
rm -f "$tmp"
@@ -47,7 +46,7 @@ ensure_env_version() {
return
fi
if [[ ! -s "$tmp" ]]; then
if [ ! -s "$tmp" ]; then
rm -f "$tmp"
regen_env_version
return