-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if [ -z "$AUTO_UPDATE_TO" ];then | ||
# auto update not configured | ||
exit 0 | ||
fi | ||
|
||
cd /opt/Internet.nl/ | ||
|
||
CURRENT_RELEASE="$RELEASE" | ||
|
||
IMAGE="${DOCKER_REGISTRY:-ghcr.io/internetstandards}/util:${AUTO_UPDATE_TO}" | ||
|
||
# pull latest image | ||
docker pull "$IMAGE" | ||
|
||
# get release info from image | ||
UPSTREAM_RELEASE="$(docker image inspect "$IMAGE" | jq -r '.[0].Config.Labels.release')" | ||
|
||
# check if update is required | ||
if [ "$CURRENT_RELEASE" = "$UPSTREAM_RELEASE" ];then | ||
echo "No update available" | ||
exit 0 | ||
fi | ||
|
||
echo "Updating to: $UPSTREAM_RELEASE" | ||
|
||
# initiate update, don't remove container when done to preserve logging | ||
# as the initiator (cron-docker) will be killed during the deploy process | ||
docker run --pull=always --network none \ | ||
--volume /var/run/docker.sock:/var/run/docker.sock \ | ||
--volume /opt/Internet.nl:/opt/Internet.nl \ | ||
"ghcr.io/internetstandards/util:$UPSTREAM_RELEASE" \ | ||
/deploy.sh |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# remove unused images, stoped containers, unused networks and build cache | ||
# --all to remove images not used by containers, --force to skip confirm prompt | ||
docker system prune --all --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters