fix: make server/migrate scripts app-agnostic
Detect the app binary by trying centralcloud_staff then centralcloud_my. Fixes CrashLoopBackOff when centralcloud-staff image ran /app/bin/server which was hardcoded to exec ./centralcloud_my (not found in staff image). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
1af4dd8dda
commit
a4ca979cc2
2 changed files with 11 additions and 2 deletions
|
|
@ -1,4 +1,9 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
cd -P -- "$(dirname -- "$0")"
|
||||
exec ./centralcloud_my eval CentralcloudMy.Release.migrate
|
||||
for pair in "centralcloud_staff CentralcloudStaff" "centralcloud_my CentralcloudMy"; do
|
||||
bin="${pair%% *}"; mod="${pair##* }"
|
||||
[ -f "./$bin" ] && exec "./$bin" eval "$mod.Release.migrate"
|
||||
done
|
||||
echo "No app binary found in $(pwd)" >&2
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
cd -P -- "$(dirname -- "$0")"
|
||||
PHX_SERVER=true exec ./centralcloud_my start
|
||||
for bin in centralcloud_staff centralcloud_my; do
|
||||
[ -f "./$bin" ] && PHX_SERVER=true exec "./$bin" start
|
||||
done
|
||||
echo "No app binary found in $(pwd)" >&2
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue