From 7a9a452f4576fa402dc969c309266e291338e2cf Mon Sep 17 00:00:00 2001 From: Simon L Date: Sun, 25 Dec 2022 00:58:09 +0100 Subject: [PATCH] rename production to services Signed-off-by: Simon L --- manual-install/update-yaml.sh | 11 +++++------ php/containers-schema.json | 2 +- php/containers.json | 2 +- php/src/ContainerDefinitionFetcher.php | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/manual-install/update-yaml.sh b/manual-install/update-yaml.sh index 4cccac2a..a0722af4 100644 --- a/manual-install/update-yaml.sh +++ b/manual-install/update-yaml.sh @@ -5,11 +5,11 @@ sed -i 's|","location":"|:|g' /tmp/containers.json sed -i 's|","writeable":false|:ro"|g' /tmp/containers.json 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(.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"))')" +OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].internalPorts)')" +OUTPUT="$(echo "$OUTPUT" | jq 'del(.services[].secrets)')" +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"))')" snap install yq mkdir -p ./manual-install @@ -17,7 +17,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 '/display_name:/d' containers.yml sed -i '/stop_grace_period:/s/$/s/' containers.yml sed -i '/: \[\]/d' containers.yml diff --git a/php/containers-schema.json b/php/containers-schema.json index e654eef0..ced642c8 100644 --- a/php/containers-schema.json +++ b/php/containers-schema.json @@ -4,7 +4,7 @@ "additionalProperties": false, "minProperties": 1, "properties": { - "production": { + "services": { "type": "array", "items": { "type": "object", diff --git a/php/containers.json b/php/containers.json index 2e7a9d75..027b4758 100644 --- a/php/containers.json +++ b/php/containers.json @@ -1,5 +1,5 @@ { - "production": [ + "services": [ { "container_name": "nextcloud-aio-apache", "depends_on": [ diff --git a/php/src/ContainerDefinitionFetcher.php b/php/src/ContainerDefinitionFetcher.php index 2adce34b..7d5ac46a 100644 --- a/php/src/ContainerDefinitionFetcher.php +++ b/php/src/ContainerDefinitionFetcher.php @@ -48,7 +48,7 @@ class ContainerDefinitionFetcher $data = json_decode(file_get_contents(__DIR__ . '/../containers.json'), true); $containers = []; - foreach ($data['production'] as $entry) { + foreach ($data['services'] as $entry) { if ($entry['container_name'] === 'nextcloud-aio-clamav') { if (!$this->configurationManager->isClamavEnabled()) { continue;