-
Notifications
You must be signed in to change notification settings - Fork 37
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
107 additions
and
10 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
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
FROM alpine:3.18 | ||
|
||
RUN apk add --no-cache curl postgresql15 | ||
RUN apk add --no-cache curl postgresql15 jq docker-cli docker-cli-compose | ||
|
||
COPY docker/cron/periodic /etc/periodic/ | ||
COPY docker/cron/update.sh /update.sh | ||
|
||
CMD crond -f -d7 | ||
# run crond in foreground and log output of crons | ||
CMD crond -f -l2 |
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,23 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if [ -z "$AUTO_UPDATE_BRANCH" ];then | ||
# auto update not configured | ||
exit 0 | ||
fi | ||
|
||
cd /opt/Internet.nl/ | ||
|
||
# shellcheck disable=SC1091 | ||
. docker/local.env | ||
|
||
CURRENT_SHA="$RELEASE" | ||
UPSTREAM_SHA="$(curl -sSLf "https://api.github.com/repos/internetstandards/Internet.nl/branches/$AUTO_UPDATE_BRANCH"| jq -r .commit.sha)" | ||
|
||
if [ "$CURRENT_SHA" = "$UPSTREAM_SHA" ];then | ||
# no update available | ||
exit 0 | ||
fi | ||
|
||
env -i RELEASE="$UPSTREAM_SHA" docker compose --env-file=docker/defaults.env --env-file=docker/host.env --env-file=docker/local.env --profile update up --no-build update |
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,18 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
cd /opt/Internet.nl/ | ||
|
||
echo "Updating to release: $RELEASE" | ||
|
||
curl --silent --show-error --fail --remote-name --location --max-redirs 0 --output-dir docker \ | ||
"https://raw.githubusercontent.com/internetstandards/Internet.nl/${RELEASE}/docker/defaults.env" | ||
curl --silent --show-error --fail --remote-name --location --max-redirs 0 --output-dir docker \ | ||
"https://raw.githubusercontent.com/internetstandards/Internet.nl/${RELEASE}/docker/docker-compose.yml" | ||
env -i RELEASE="$RELEASE" docker compose --env-file=docker/defaults.env --env-file=docker/host.env --env-file=docker/local.env pull | ||
env -i RELEASE="$RELEASE" docker compose --env-file=docker/defaults.env --env-file=docker/host.env --env-file=docker/local.env up --remove-orphans --wait --no-build | ||
|
||
echo "RELEASE=$RELEASE # auto-update: '$AUTO_UPDATE_BRANCH' $(date)" >> docker/local.env | ||
|
||
echo "Update completed" |
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