Skip to content

Commit cc8e72f

Browse files
committed
fix: iac ensure docker compose up on start
1 parent ffc573a commit cc8e72f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎iac/entrypoint.sh‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ perform_update() {
384384
# only at the next push: clone_or_pull_repo reports "no new commit" and the
385385
# branch below never looks at system.json.
386386
if [[ "${state}" != "0" ]] && \
387-
[[ "${subdir}" != "$(get_state '.iac_subdir // ""')" ]]; then
387+
[[ "${subdir}" != "$(get_state '.iac_subdir // "%"')" ]]; then
388388
report "Info: iac_repo_subdir is now '${subdir:-<repo root>}'."
389389
state=0
390390
fi
@@ -428,7 +428,7 @@ perform_update() {
428428
set_state '.last_iac_update = (now | todate)'
429429
counter=0
430430
else
431-
set_state '.iac_subdir = ""'
431+
set_state '.iac_subdir = "%"'
432432
set_state --arg failed "${failed}" '.iac_state = $failed'
433433
return 1
434434
fi
@@ -445,6 +445,13 @@ perform_update() {
445445
}
446446

447447
ensure_start() {
448+
local subdir
449+
subdir="$(jq -r '.iac_repo_subdir // empty' "$CONFIG_PATH")"
450+
REPO_DIR_SUBDIR=""
451+
if [ -n "$subdir" ]; then
452+
REPO_DIR_SUBDIR="/$subdir"
453+
fi
454+
448455
if ! run_docker_compose; then
449456
set_state '.iac_state = "docker compose failed"'
450457
return 1

0 commit comments

Comments
 (0)