First stage refactor for dynamic app specs (napps.scm).

This commit is contained in:
2026-07-02 19:39:56 -07:00
parent 868e00ac41
commit 04407b16b0
49 changed files with 420 additions and 253 deletions

View File

@@ -5,18 +5,18 @@
# it depends on apps.config which should define:
# ROOT_DOMAIN - the root domain for all apps
# APP_CONFIGS - app-subdomain pairs, configured via a comma, like:
# app1,subdomain1 app2,subdomain2 app3,subdomain3
# APP_CONFIGS - app-subdomain-version pairs, configured via a comma, like:
# app1,subdomain1,version app2,subdomain2,version app3,subdomain3,version
# full example:
# ROOT_DOMAIN=nassella.cc
# APP_CONFIGS="app1,subdomain1 app2,subdomain2 app3,subdomain3"
# APP_CONFIGS="app1,subdomain1,1 app2,subdomain2,1 app3,subdomain3,1"
set -e
. $1 # source the apps.config file with then env vars
. $1 # source the apps.config file with the env vars
read -r -a APP_CONFIGS <<< "$APP_CONFIGS"
APP_CONFIGS+=('lb,root')
# APP_CONFIGS+=('lb,root,1') # TODO is this used anymore?
for config_string in ${APP_CONFIGS[@]}; do
@@ -24,8 +24,10 @@ for config_string in ${APP_CONFIGS[@]}; do
read -r -a config <<< "$config_string"
app=${config[0]}
cp -a all-apps/$app app/
version=${config[2]}
cp -a all-apps/$app/$version app/$app
done
# compose .env files
# (compose only supports one .env file at the root by default)
find app/ -name ".compose-env" -exec cat > app/.env {} +