Helper to auto deploy from cron
All checks were successful
docker-image / docker (push) Successful in 10m11s
All checks were successful
docker-image / docker (push) Successful in 10m11s
This commit is contained in:
parent
7702de275c
commit
82d4f40a08
1 changed files with 17 additions and 0 deletions
17
scripts/pull-and-restart.sh
Executable file
17
scripts/pull-and-restart.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Try to pull the most recent image, and restart docker compose if it has changes
|
||||
#
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "usage: pull-and-restart image compose.yaml" >&2
|
||||
exit 64
|
||||
fi
|
||||
|
||||
before="$(docker inspect --format='{{index .RepoDigests 0}}' $1)"
|
||||
docker pull docker inspect --format='{{index .RepoDigests 0}}'
|
||||
after="$(docker inspect --format='{{index .RepoDigests 0}}' $1)"
|
||||
|
||||
if [ "$before" != "$after" ]; then
|
||||
docker compose -f $2 up -d
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue