Skip to content

Commit 9f80d83

Browse files
DEV: allow multiple configure runs (#828)
when we have already run an initial setup, fall back to just checking for socket, rather than outright failing if the init script has already been run. This allows 'configure' steps to be re-run in standalone cases. eg: `launcher2 configure app && launcher2 configure app` current version: fails as it's missing the install_postgres file with PR: checks for psql socket, and builds. doing something like `launcher2 start app && launcher2 configure app` would also print out a more correct error message, "postgres already running stop container"
1 parent 618ab51 commit 9f80d83

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

templates/postgres.15.template.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ run:
220220

221221
- exec:
222222
tag: db
223-
cmd: "[ -f /root/install_postgres ] && /root/install_postgres && rm -f /root/install_postgres"
223+
cmd: |
224+
if [ -f /root/install_postgres ]; then
225+
/root/install_postgres && rm -f /root/install_postgres
226+
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
227+
socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
228+
fi
224229
225230
- exec:
226231
tag: db

templates/postgres.template.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,12 @@ run:
208208

209209
- exec:
210210
tag: db
211-
cmd: "[ -f /root/install_postgres ] && /root/install_postgres && rm -f /root/install_postgres"
211+
cmd: |
212+
if [ -f /root/install_postgres ]; then
213+
/root/install_postgres && rm -f /root/install_postgres
214+
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
215+
socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
216+
fi
212217
213218
- exec:
214219
tag: db

0 commit comments

Comments
 (0)