Skip to content

Commit

Permalink
compose script: allow to pass extra options to up operation
Browse files Browse the repository at this point in the history
When disabling components, their existing containers will not be removed
unless option `--remove-orphans` is given together with `./pavics-compose.sh up -d`.

This change allow any additional options, not just `--remove-orphans`.
  • Loading branch information
tlvu committed Feb 23, 2024
1 parent d69088b commit 7567e8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@

To avoid drowing real WARN messages. Many optional vars can be valid if empty.

- compose script: allow to pass extra options to `up` operation

When disabling components, their existing containers will not be removed
unless option `--remove-orphans` is given together with `./pavics-compose.sh up -d`.

This change allow any additional options, not just `--remove-orphans`.


[2.1.0](https://github.com/bird-house/birdhouse-deploy/tree/2.1.0) (2024-02-23)
------------------------------------------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions birdhouse/env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ export GEOSERVER_ADMIN_PASSWORD="${__DEFAULT__GEOSERVER_ADMIN_PASSWORD}"
# within the autodeploy docker container as the root user.
#export AUTODEPLOY_CODE_OWNERSHIP="1000:1000"

# Extra options for 'pavics-compose.sh up -d'.
# --remove-orphans useful when disabling components. Harmless when left enabled all the time.
#export COMPOSE_UP_EXTRA_OPTS="--remove-orphans"

# Load pre-configured job to auto-renew LetsEncrypt SSL certificate if a
# LetsEncrypt SSL certificate has previously been requested.
#
Expand Down
5 changes: 4 additions & 1 deletion birdhouse/pavics-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ if [ x"$1" = x"info" ]; then
exit 0
fi

COMPOSE_EXTRA_OPTS=""

if [ x"$1" = x"up" ]; then
COMPOSE_EXTRA_OPTS="${COMPOSE_UP_EXTRA_OPTS}"
for adir in $ALL_CONF_DIRS; do
COMPONENT_PRE_COMPOSE_UP="$adir/pre-docker-compose-up"
if [ -x "$COMPONENT_PRE_COMPOSE_UP" ]; then
Expand All @@ -116,7 +119,7 @@ if [ x"$1" = x"up" ]; then
fi

# the PROXY_SECURE_PORT is a little trick to make the compose file invalid without the usage of this wrapper script
PROXY_SECURE_PORT=443 HOSTNAME=${PAVICS_FQDN} docker-compose ${COMPOSE_CONF_LIST} $*
PROXY_SECURE_PORT=443 HOSTNAME=${PAVICS_FQDN} docker-compose ${COMPOSE_CONF_LIST} ${COMPOSE_EXTRA_OPTS} $*
ERR=$?

# execute post-compose function if exists and no error occurred
Expand Down

0 comments on commit 7567e8d

Please sign in to comment.