Only copy docker configs for selected apps.
This commit is contained in:
8
Makefile
8
Makefile
@@ -13,7 +13,11 @@ $(wildcard all-apps/ghost/*) \
|
|||||||
$(wildcard all-apps/dozzle/*)
|
$(wildcard all-apps/dozzle/*)
|
||||||
|
|
||||||
rm -Rf app/
|
rm -Rf app/
|
||||||
cp -a all-apps app && touch $@
|
mkdir app/
|
||||||
|
cp all-apps/app.service app/
|
||||||
|
cp all-apps/docker-compose.yaml app/
|
||||||
|
cp all-apps/.env app/
|
||||||
|
./copy-apps.sh $(apps_config) && touch $@
|
||||||
|
|
||||||
# compose .env files
|
# compose .env files
|
||||||
# (compose only supports one .env file at the root by default)
|
# (compose only supports one .env file at the root by default)
|
||||||
@@ -96,7 +100,7 @@ restic-snapshots: $(apps_config) restic-password
|
|||||||
.PHONY: archive
|
.PHONY: archive
|
||||||
archive:
|
archive:
|
||||||
tar -cf nassella-latest.tar all-apps cl.yaml init-restic.sh main.tf make-caddyfile.sh Makefile \
|
tar -cf nassella-latest.tar all-apps cl.yaml init-restic.sh main.tf make-caddyfile.sh Makefile \
|
||||||
make-generated.sh make-nextcloud-env.sh make-ghost-env.sh make-restic-generated.sh make-restic-password.sh restic-snapshots.sh \
|
make-generated.sh make-nextcloud-env.sh make-ghost-env.sh make-restic-generated.sh make-restic-password.sh restic-snapshots.sh copy-apps.sh \
|
||||||
.terraform .terraform.lock.hcl
|
.terraform .terraform.lock.hcl
|
||||||
cp nassella-latest.tar src/
|
cp nassella-latest.tar src/
|
||||||
|
|
||||||
|
|||||||
31
copy-apps.sh
Executable file
31
copy-apps.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# this script copys over the docker configs
|
||||||
|
# for in-use apps
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# full example:
|
||||||
|
# ROOT_DOMAIN=nassella.cc
|
||||||
|
# APP_CONFIGS="app1,subdomain1 app2,subdomain2 app3,subdomain3"
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. $1 # source the apps.config file with then env vars
|
||||||
|
|
||||||
|
read -r -a APP_CONFIGS <<< "$APP_CONFIGS"
|
||||||
|
APP_CONFIGS+=('lb,root')
|
||||||
|
|
||||||
|
|
||||||
|
for config_string in ${APP_CONFIGS[@]}; do
|
||||||
|
IFS=','
|
||||||
|
read -r -a config <<< "$config_string"
|
||||||
|
|
||||||
|
app=${config[0]}
|
||||||
|
cp -a all-apps/$app app/
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user