require image_tag and add %AIO_CHANNEL% variable

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-09-07 14:26:42 +02:00
parent 8e4678fe82
commit 6e17dec951
5 changed files with 22 additions and 5 deletions

View file

@ -17,6 +17,7 @@ OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].secrets)')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].devices)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].devices)')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].backup_volumes)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].backup_volumes)')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].nextcloud_exec_commands)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].nextcloud_exec_commands)')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].image_tag)')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-watchtower"))')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-watchtower"))')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-domaincheck"))')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-domaincheck"))')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-borgbackup"))')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-borgbackup"))')"

View file

@ -10,7 +10,7 @@
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"minProperties": 2, "minProperties": 2,
"required": ["image", "container_name"], "required": ["image", "container_name", "image_tag"],
"properties": { "properties": {
"image": { "image": {
"type": "string", "type": "string",
@ -98,7 +98,7 @@
}, },
"image_tag": { "image_tag": {
"type": "string", "type": "string",
"pattern": "^[a-z0-9.-]+$" "pattern": "^([a-z0-9.-]+|%AIO_CHANNEL%)$"
}, },
"devices": { "devices": {
"type": "array", "type": "array",

View file

@ -2,6 +2,7 @@
"aio_services_v1": [ "aio_services_v1": [
{ {
"container_name": "nextcloud-aio-apache", "container_name": "nextcloud-aio-apache",
"image_tag": "%AIO_CHANNEL%",
"depends_on": [ "depends_on": [
"nextcloud-aio-onlyoffice", "nextcloud-aio-onlyoffice",
"nextcloud-aio-collabora", "nextcloud-aio-collabora",
@ -68,6 +69,7 @@
}, },
{ {
"container_name": "nextcloud-aio-database", "container_name": "nextcloud-aio-database",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Database", "display_name": "Database",
"image": "nextcloud/aio-postgresql", "image": "nextcloud/aio-postgresql",
"init": true, "init": true,
@ -114,6 +116,7 @@
}, },
{ {
"container_name": "nextcloud-aio-nextcloud", "container_name": "nextcloud-aio-nextcloud",
"image_tag": "%AIO_CHANNEL%",
"depends_on": [ "depends_on": [
"nextcloud-aio-database", "nextcloud-aio-database",
"nextcloud-aio-redis", "nextcloud-aio-redis",
@ -221,6 +224,7 @@
}, },
{ {
"container_name": "nextcloud-aio-notify-push", "container_name": "nextcloud-aio-notify-push",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Notify Push", "display_name": "Notify Push",
"image": "nextcloud/aio-notify-push", "image": "nextcloud/aio-notify-push",
"init": true, "init": true,
@ -257,6 +261,7 @@
}, },
{ {
"container_name": "nextcloud-aio-redis", "container_name": "nextcloud-aio-redis",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Redis", "display_name": "Redis",
"image": "nextcloud/aio-redis", "image": "nextcloud/aio-redis",
"init": true, "init": true,
@ -288,6 +293,7 @@
}, },
{ {
"container_name": "nextcloud-aio-collabora", "container_name": "nextcloud-aio-collabora",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Collabora", "display_name": "Collabora",
"image": "nextcloud/aio-collabora", "image": "nextcloud/aio-collabora",
"init": true, "init": true,
@ -317,6 +323,7 @@
}, },
{ {
"container_name": "nextcloud-aio-talk", "container_name": "nextcloud-aio-talk",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Talk", "display_name": "Talk",
"image": "nextcloud/aio-talk", "image": "nextcloud/aio-talk",
"init": true, "init": true,
@ -368,6 +375,7 @@
}, },
{ {
"container_name": "nextcloud-aio-talk-recording", "container_name": "nextcloud-aio-talk-recording",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Talk Recording", "display_name": "Talk Recording",
"image": "nextcloud/aio-talk-recording", "image": "nextcloud/aio-talk-recording",
"init": true, "init": true,
@ -401,6 +409,7 @@
}, },
{ {
"container_name": "nextcloud-aio-borgbackup", "container_name": "nextcloud-aio-borgbackup",
"image_tag": "%AIO_CHANNEL%",
"image": "nextcloud/aio-borgbackup", "image": "nextcloud/aio-borgbackup",
"init": true, "init": true,
"environment": [ "environment": [
@ -463,6 +472,7 @@
}, },
{ {
"container_name": "nextcloud-aio-watchtower", "container_name": "nextcloud-aio-watchtower",
"image_tag": "%AIO_CHANNEL%",
"image": "nextcloud/aio-watchtower", "image": "nextcloud/aio-watchtower",
"init": true, "init": true,
"environment": [ "environment": [
@ -479,6 +489,7 @@
}, },
{ {
"container_name": "nextcloud-aio-domaincheck", "container_name": "nextcloud-aio-domaincheck",
"image_tag": "%AIO_CHANNEL%",
"image": "nextcloud/aio-domaincheck", "image": "nextcloud/aio-domaincheck",
"init": true, "init": true,
"ports": [ "ports": [
@ -505,6 +516,7 @@
}, },
{ {
"container_name": "nextcloud-aio-clamav", "container_name": "nextcloud-aio-clamav",
"image_tag": "%AIO_CHANNEL%",
"display_name": "ClamAV", "display_name": "ClamAV",
"image": "nextcloud/aio-clamav", "image": "nextcloud/aio-clamav",
"init": false, "init": false,
@ -539,6 +551,7 @@
}, },
{ {
"container_name": "nextcloud-aio-onlyoffice", "container_name": "nextcloud-aio-onlyoffice",
"image_tag": "%AIO_CHANNEL%",
"display_name": "OnlyOffice", "display_name": "OnlyOffice",
"image": "nextcloud/aio-onlyoffice", "image": "nextcloud/aio-onlyoffice",
"init": true, "init": true,
@ -576,6 +589,7 @@
}, },
{ {
"container_name": "nextcloud-aio-imaginary", "container_name": "nextcloud-aio-imaginary",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Imaginary", "display_name": "Imaginary",
"image": "nextcloud/aio-imaginary", "image": "nextcloud/aio-imaginary",
"init": true, "init": true,
@ -603,6 +617,7 @@
}, },
{ {
"container_name": "nextcloud-aio-fulltextsearch", "container_name": "nextcloud-aio-fulltextsearch",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Fulltextsearch", "display_name": "Fulltextsearch",
"image": "nextcloud/aio-fulltextsearch", "image": "nextcloud/aio-fulltextsearch",
"init": false, "init": false,
@ -642,6 +657,7 @@
}, },
{ {
"container_name": "nextcloud-aio-docker-socket-proxy", "container_name": "nextcloud-aio-docker-socket-proxy",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Docker Socket Proxy", "display_name": "Docker Socket Proxy",
"image": "nextcloud/aio-docker-socket-proxy", "image": "nextcloud/aio-docker-socket-proxy",
"init": true, "init": true,

View file

@ -269,7 +269,7 @@ class ContainerDefinitionFetcher
$init = $entry['init']; $init = $entry['init'];
} }
$imageTag = ''; $imageTag = '%AIO_CHANNEL%';
if (isset($entry['image_tag'])) { if (isset($entry['image_tag'])) {
$imageTag = $entry['image_tag']; $imageTag = $entry['image_tag'];
} }

View file

@ -49,7 +49,7 @@ class DockerActionManager
private function BuildImageName(Container $container) : string { private function BuildImageName(Container $container) : string {
$tag = $container->GetImageTag(); $tag = $container->GetImageTag();
if ($tag === '') { if ($tag === '%AIO_CHANNEL%') {
$tag = $this->GetCurrentChannel(); $tag = $this->GetCurrentChannel();
} }
return $container->GetContainerName() . ':' . $tag; return $container->GetContainerName() . ':' . $tag;
@ -100,7 +100,7 @@ class DockerActionManager
public function GetContainerUpdateState(Container $container) : IContainerState public function GetContainerUpdateState(Container $container) : IContainerState
{ {
$tag = $container->GetImageTag(); $tag = $container->GetImageTag();
if ($tag === '') { if ($tag === '%AIO_CHANNEL%') {
$tag = $this->GetCurrentChannel(); $tag = $this->GetCurrentChannel();
} }