mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
feat: support container network mode (#1429)
Co-authored-by: nils måsén <nils@piksel.se> Co-authored-by: Andreas Åhman <andreas.ahman@ingka.ikea.com>
This commit is contained in:
parent
bba9b2b100
commit
dca45f50cb
15 changed files with 1379 additions and 47 deletions
42
scripts/contnet-tests.sh
Executable file
42
scripts/contnet-tests.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
function exit_env_err() {
|
||||
>&2 echo "Required environment variable not set: $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ -z "$VPN_SERVICE_PROVIDER" ]; then exit_env_err "VPN_SERVICE_PROVIDER"; fi
|
||||
if [ -z "$OPENVPN_USER" ]; then exit_env_err "OPENVPN_USER"; fi
|
||||
if [ -z "$OPENVPN_PASSWORD" ]; then exit_env_err "OPENVPN_PASSWORD"; fi
|
||||
# if [ -z "$SERVER_COUNTRIES" ]; then exit_env_err "SERVER_COUNTRIES"; fi
|
||||
|
||||
|
||||
export SERVER_COUNTRIES=${SERVER_COUNTRIES:"Sweden"}
|
||||
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
||||
COMPOSE_FILE="$REPO_ROOT/dockerfiles/container-networking/docker-compose.yml"
|
||||
DEFAULT_WATCHTOWER="$REPO_ROOT/watchtower"
|
||||
WATCHTOWER="$*"
|
||||
WATCHTOWER=${WATCHTOWER:-$DEFAULT_WATCHTOWER}
|
||||
echo "repo root path is $REPO_ROOT"
|
||||
echo "watchtower path is $WATCHTOWER"
|
||||
echo "compose file path is $COMPOSE_FILE"
|
||||
|
||||
echo; echo "=== Forcing network container producer update..."
|
||||
|
||||
echo "Pull previous version of gluetun..."
|
||||
docker pull qmcgaw/gluetun:v3.34.3
|
||||
echo "Fake new version of gluetun by retagging v3.34.4 as v3.35.0..."
|
||||
docker tag qmcgaw/gluetun:v3.34.3 qmcgaw/gluetun:v3.35.0
|
||||
|
||||
echo; echo "=== Creating containers..."
|
||||
|
||||
docker compose -p "wt-contnet" -f "$COMPOSE_FILE" up -d
|
||||
|
||||
echo; echo "=== Running watchtower"
|
||||
$WATCHTOWER --run-once
|
||||
|
||||
echo; echo "=== Removing containers..."
|
||||
|
||||
docker compose -p "wt-contnet" -f "$COMPOSE_FILE" down
|
Loading…
Add table
Add a link
Reference in a new issue