From 7720ed50616872af3375ee07a4fcb55bab9bde98 Mon Sep 17 00:00:00 2001 From: Simon L Date: Sun, 25 Dec 2022 00:36:19 +0100 Subject: [PATCH] rename identifier to container_name Signed-off-by: Simon L --- manual-install/update-yaml.sh | 7 +++---- php/containers-schema.json | 2 +- php/containers.json | 26 +++++++++++++------------- php/src/ContainerDefinitionFetcher.php | 14 +++++++------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/manual-install/update-yaml.sh b/manual-install/update-yaml.sh index ac6a9ae9..b5ad664c 100644 --- a/manual-install/update-yaml.sh +++ b/manual-install/update-yaml.sh @@ -7,9 +7,9 @@ sed -i 's|","writeable":true|:rw"|g' /tmp/containers.json OUTPUT="$(cat /tmp/containers.json)" OUTPUT="$(echo "$OUTPUT" | jq 'del(.production[].internalPorts)')" OUTPUT="$(echo "$OUTPUT" | jq 'del(.production[].secrets)')" -OUTPUT="$(echo "$OUTPUT" | jq 'del(.production[] | select(.identifier == "nextcloud-aio-watchtower"))')" -OUTPUT="$(echo "$OUTPUT" | jq 'del(.production[] | select(.identifier == "nextcloud-aio-domaincheck"))')" -OUTPUT="$(echo "$OUTPUT" | jq 'del(.production[] | select(.identifier == "nextcloud-aio-borgbackup"))')" +OUTPUT="$(echo "$OUTPUT" | jq 'del(.production[] | select(.container_name == "nextcloud-aio-watchtower"))')" +OUTPUT="$(echo "$OUTPUT" | jq 'del(.production[] | select(.container_name == "nextcloud-aio-domaincheck"))')" +OUTPUT="$(echo "$OUTPUT" | jq 'del(.production[] | select(.container_name == "nextcloud-aio-borgbackup"))')" snap install yq mkdir -p ./manual-install @@ -18,7 +18,6 @@ echo "$OUTPUT" | yq -P > ./manual-install/containers.yml cd manual-install || exit sed -i "s|'||g" containers.yml sed -i 's|production:|services:|' containers.yml -sed -i 's|- identifier:| container_name:|' containers.yml sed -i 's|restartPolicy:|restart:|' containers.yml sed -i 's|environmentVariables:|environment:|' containers.yml sed -i '/displayName:/d' containers.yml diff --git a/php/containers-schema.json b/php/containers-schema.json index 1a668d38..69894f0c 100644 --- a/php/containers-schema.json +++ b/php/containers-schema.json @@ -29,7 +29,7 @@ "type": "string" } }, - "identifier": { + "container_name": { "type": "string" }, "internalPorts": { diff --git a/php/containers.json b/php/containers.json index 77bbcb76..90a143cd 100644 --- a/php/containers.json +++ b/php/containers.json @@ -1,7 +1,7 @@ { "production": [ { - "identifier": "nextcloud-aio-apache", + "container_name": "nextcloud-aio-apache", "dependsOn": [ "nextcloud-aio-onlyoffice", "nextcloud-aio-collabora", @@ -44,7 +44,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-database", + "container_name": "nextcloud-aio-database", "dependsOn": [], "displayName": "Database", "containerName": "nextcloud/aio-postgresql", @@ -78,7 +78,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-nextcloud", + "container_name": "nextcloud-aio-nextcloud", "dependsOn": [ "nextcloud-aio-database", "nextcloud-aio-redis", @@ -166,7 +166,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-redis", + "container_name": "nextcloud-aio-redis", "dependsOn": [], "displayName": "Redis", "containerName": "nextcloud/aio-redis", @@ -193,7 +193,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-collabora", + "container_name": "nextcloud-aio-collabora", "dependsOn": [], "displayName": "Collabora", "containerName": "nextcloud/aio-collabora", @@ -219,7 +219,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-talk", + "container_name": "nextcloud-aio-talk", "dependsOn": [], "displayName": "Talk", "containerName": "nextcloud/aio-talk", @@ -248,7 +248,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-borgbackup", + "container_name": "nextcloud-aio-borgbackup", "dependsOn": [], "displayName": "Borgbackup", "containerName": "nextcloud/aio-borgbackup", @@ -321,7 +321,7 @@ "restartPolicy": "" }, { - "identifier": "nextcloud-aio-watchtower", + "container_name": "nextcloud-aio-watchtower", "dependsOn": [], "displayName": "Watchtower", "containerName": "nextcloud/aio-watchtower", @@ -343,7 +343,7 @@ }, { "dependsOn": [], - "identifier": "nextcloud-aio-domaincheck", + "container_name": "nextcloud-aio-domaincheck", "displayName": "Domaincheck", "containerName": "nextcloud/aio-domaincheck", "ports": [ @@ -362,7 +362,7 @@ "restartPolicy": "" }, { - "identifier": "nextcloud-aio-clamav", + "container_name": "nextcloud-aio-clamav", "dependsOn": [], "displayName": "ClamAV", "containerName": "nextcloud/aio-clamav", @@ -386,7 +386,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-onlyoffice", + "container_name": "nextcloud-aio-onlyoffice", "dependsOn": [], "displayName": "OnlyOffice", "containerName": "nextcloud/aio-onlyoffice", @@ -414,7 +414,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-imaginary", + "container_name": "nextcloud-aio-imaginary", "dependsOn": [], "displayName": "Imaginary", "containerName": "nextcloud/aio-imaginary", @@ -431,7 +431,7 @@ "restartPolicy": "unless-stopped" }, { - "identifier": "nextcloud-aio-fulltextsearch", + "container_name": "nextcloud-aio-fulltextsearch", "dependsOn": [], "displayName": "Fulltextsearch", "containerName": "nextcloud/aio-fulltextsearch", diff --git a/php/src/ContainerDefinitionFetcher.php b/php/src/ContainerDefinitionFetcher.php index f2d30804..6c5266d4 100644 --- a/php/src/ContainerDefinitionFetcher.php +++ b/php/src/ContainerDefinitionFetcher.php @@ -49,27 +49,27 @@ class ContainerDefinitionFetcher $containers = []; foreach ($data['production'] as $entry) { - if ($entry['identifier'] === 'nextcloud-aio-clamav') { + if ($entry['container_name'] === 'nextcloud-aio-clamav') { if (!$this->configurationManager->isClamavEnabled()) { continue; } - } elseif ($entry['identifier'] === 'nextcloud-aio-onlyoffice') { + } elseif ($entry['container_name'] === 'nextcloud-aio-onlyoffice') { if (!$this->configurationManager->isOnlyofficeEnabled()) { continue; } - } elseif ($entry['identifier'] === 'nextcloud-aio-collabora') { + } elseif ($entry['container_name'] === 'nextcloud-aio-collabora') { if (!$this->configurationManager->isCollaboraEnabled()) { continue; } - } elseif ($entry['identifier'] === 'nextcloud-aio-talk') { + } elseif ($entry['container_name'] === 'nextcloud-aio-talk') { if (!$this->configurationManager->isTalkEnabled()) { continue; } - } elseif ($entry['identifier'] === 'nextcloud-aio-imaginary') { + } elseif ($entry['container_name'] === 'nextcloud-aio-imaginary') { if (!$this->configurationManager->isImaginaryEnabled()) { continue; } - } elseif ($entry['identifier'] === 'nextcloud-aio-fulltextsearch') { + } elseif ($entry['container_name'] === 'nextcloud-aio-fulltextsearch') { if (!$this->configurationManager->isFulltextsearchEnabled()) { continue; } @@ -177,7 +177,7 @@ class ContainerDefinitionFetcher } $containers[] = new Container( - $entry['identifier'], + $entry['container_name'], $entry['displayName'], $entry['containerName'], $entry['restartPolicy'],