Skip to content

Commit

Permalink
Merge pull request #3314 from nextcloud/enh/1581/require-image-tag
Browse files Browse the repository at this point in the history
  • Loading branch information
szaimen authored Sep 27, 2023
2 parents 8e4678f + 6e17dec commit c320da2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions manual-install/update-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].secrets)')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].devices)')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].backup_volumes)')"
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-domaincheck"))')"
OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[] | select(.container_name == "nextcloud-aio-borgbackup"))')"
Expand Down
4 changes: 2 additions & 2 deletions php/containers-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "object",
"additionalProperties": false,
"minProperties": 2,
"required": ["image", "container_name"],
"required": ["image", "container_name", "image_tag"],
"properties": {
"image": {
"type": "string",
Expand Down Expand Up @@ -98,7 +98,7 @@
},
"image_tag": {
"type": "string",
"pattern": "^[a-z0-9.-]+$"
"pattern": "^([a-z0-9.-]+|%AIO_CHANNEL%)$"
},
"devices": {
"type": "array",
Expand Down
16 changes: 16 additions & 0 deletions php/containers.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"aio_services_v1": [
{
"container_name": "nextcloud-aio-apache",
"image_tag": "%AIO_CHANNEL%",
"depends_on": [
"nextcloud-aio-onlyoffice",
"nextcloud-aio-collabora",
Expand Down Expand Up @@ -68,6 +69,7 @@
},
{
"container_name": "nextcloud-aio-database",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Database",
"image": "nextcloud/aio-postgresql",
"init": true,
Expand Down Expand Up @@ -114,6 +116,7 @@
},
{
"container_name": "nextcloud-aio-nextcloud",
"image_tag": "%AIO_CHANNEL%",
"depends_on": [
"nextcloud-aio-database",
"nextcloud-aio-redis",
Expand Down Expand Up @@ -221,6 +224,7 @@
},
{
"container_name": "nextcloud-aio-notify-push",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Notify Push",
"image": "nextcloud/aio-notify-push",
"init": true,
Expand Down Expand Up @@ -257,6 +261,7 @@
},
{
"container_name": "nextcloud-aio-redis",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Redis",
"image": "nextcloud/aio-redis",
"init": true,
Expand Down Expand Up @@ -288,6 +293,7 @@
},
{
"container_name": "nextcloud-aio-collabora",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Collabora",
"image": "nextcloud/aio-collabora",
"init": true,
Expand Down Expand Up @@ -317,6 +323,7 @@
},
{
"container_name": "nextcloud-aio-talk",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Talk",
"image": "nextcloud/aio-talk",
"init": true,
Expand Down Expand Up @@ -368,6 +375,7 @@
},
{
"container_name": "nextcloud-aio-talk-recording",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Talk Recording",
"image": "nextcloud/aio-talk-recording",
"init": true,
Expand Down Expand Up @@ -401,6 +409,7 @@
},
{
"container_name": "nextcloud-aio-borgbackup",
"image_tag": "%AIO_CHANNEL%",
"image": "nextcloud/aio-borgbackup",
"init": true,
"environment": [
Expand Down Expand Up @@ -463,6 +472,7 @@
},
{
"container_name": "nextcloud-aio-watchtower",
"image_tag": "%AIO_CHANNEL%",
"image": "nextcloud/aio-watchtower",
"init": true,
"environment": [
Expand All @@ -479,6 +489,7 @@
},
{
"container_name": "nextcloud-aio-domaincheck",
"image_tag": "%AIO_CHANNEL%",
"image": "nextcloud/aio-domaincheck",
"init": true,
"ports": [
Expand All @@ -505,6 +516,7 @@
},
{
"container_name": "nextcloud-aio-clamav",
"image_tag": "%AIO_CHANNEL%",
"display_name": "ClamAV",
"image": "nextcloud/aio-clamav",
"init": false,
Expand Down Expand Up @@ -539,6 +551,7 @@
},
{
"container_name": "nextcloud-aio-onlyoffice",
"image_tag": "%AIO_CHANNEL%",
"display_name": "OnlyOffice",
"image": "nextcloud/aio-onlyoffice",
"init": true,
Expand Down Expand Up @@ -576,6 +589,7 @@
},
{
"container_name": "nextcloud-aio-imaginary",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Imaginary",
"image": "nextcloud/aio-imaginary",
"init": true,
Expand Down Expand Up @@ -603,6 +617,7 @@
},
{
"container_name": "nextcloud-aio-fulltextsearch",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Fulltextsearch",
"image": "nextcloud/aio-fulltextsearch",
"init": false,
Expand Down Expand Up @@ -642,6 +657,7 @@
},
{
"container_name": "nextcloud-aio-docker-socket-proxy",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Docker Socket Proxy",
"image": "nextcloud/aio-docker-socket-proxy",
"init": true,
Expand Down
2 changes: 1 addition & 1 deletion php/src/ContainerDefinitionFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private function GetDefinition(bool $latest): array
$init = $entry['init'];
}

$imageTag = '';
$imageTag = '%AIO_CHANNEL%';
if (isset($entry['image_tag'])) {
$imageTag = $entry['image_tag'];
}
Expand Down
4 changes: 2 additions & 2 deletions php/src/Docker/DockerActionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function BuildApiUrl(string $url) : string {

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

Expand Down

0 comments on commit c320da2

Please sign in to comment.