From 156a954a8435b31de8524d70ef1d56fdf2381310 Mon Sep 17 00:00:00 2001 From: Koen Metsu Date: Mon, 18 Dec 2023 15:46:16 +0100 Subject: [PATCH 1/8] feat: or-1349 add first script and image --- .aws/Dockerfile | 11 +++++ .aws/scripts/ecs-desired-count.sh | 75 +++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .aws/Dockerfile create mode 100755 .aws/scripts/ecs-desired-count.sh diff --git a/.aws/Dockerfile b/.aws/Dockerfile new file mode 100644 index 000000000..1ec4821a2 --- /dev/null +++ b/.aws/Dockerfile @@ -0,0 +1,11 @@ +FROM public.ecr.aws/aws-cli/aws-cli:2.15.2 + +RUN yum install -y bash + +WORKDIR /app + +COPY scripts/ecs-desired-count.sh . + +RUN chmod +x ./ecs-desired-count.sh + +ENTRYPOINT ["./ecs-desired-count.sh"] \ No newline at end of file diff --git a/.aws/scripts/ecs-desired-count.sh b/.aws/scripts/ecs-desired-count.sh new file mode 100755 index 000000000..8cecd7b24 --- /dev/null +++ b/.aws/scripts/ecs-desired-count.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +# Function to update the desired count of a service +update_service_count() { + local cluster=$1 + local service=$2 + local count=$3 + echo "Updating $service to desired count: $count" + aws ecs update-service --cluster "$cluster" --service "$service" --desired-count "$count" +} + +# Function to wait for the desired count to be reached +wait_for_desired_count() { + local cluster=$1 + local service=$2 + local desired_count=$3 + + echo "Waiting for $service to reach desired count: $desired_count" + while :; do + current_count=$(aws ecs describe-services --cluster "$cluster" --services "$service" --query "services[0].runningCount" --output text) + if [[ "$current_count" -eq "$desired_count" ]]; then + echo "$service has reached the desired count: $desired_count" + break + else + echo "Current count for $service is $current_count. Waiting..." + sleep 10 + fi + done +} + +# Check for minimum required parameters: at least one service name +if [ "$#" -lt 2 ]; then + echo "Usage: $0 cluster-name service1 [service2 ...]" + exit 1 +fi + +# Disable CLI paging for this script +export AWS_PAGER="" + +# First argument is the cluster, the rest are services +CLUSTER_ARN=$1 +shift +SERVICES=("$@") + +# Associative array to store original desired counts +declare -A original_counts + +# Get the original desired counts and downscale services +for service in "${SERVICES[@]}"; do + original_count=$(aws ecs describe-services --cluster "$CLUSTER_ARN" --services "$service" --query "services[0].desiredCount" --output text) + original_counts["$service"]=$original_count + update_service_count "$CLUSTER_ARN" "$service" 0 +done + +for service in "${SERVICES[@]}"; do + original_count=$(aws ecs describe-services --cluster "$CLUSTER_ARN" --services "$service" --query "services[0].desiredCount" --output text) + original_counts["$service"]=$original_count + wait_for_desired_count "$CLUSTER_ARN" "$service" 0 +done + +# Main script operations +# Place any operations you need to perform while the services are downscaled here + +# Restore services to their original desired counts +for service in "${SERVICES[@]}"; do + original_count=${original_counts["$service"]} + update_service_count "$CLUSTER_ARN" "$service" "$original_count" +done + +for service in "${SERVICES[@]}"; do + original_count=${original_counts["$service"]} + wait_for_desired_count "$CLUSTER_ARN" "$service" "$original_count" +done + +echo "All services have been restored to their original scaling." From 7c11645cec972e072c41da3bd86ea172b3b61e8f Mon Sep 17 00:00:00 2001 From: Koen Metsu Date: Tue, 19 Dec 2023 14:23:52 +0100 Subject: [PATCH 2/8] feat: or-1349 add script to sln --- AssociationRegistry.sln | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AssociationRegistry.sln b/AssociationRegistry.sln index 0ea4a85fe..acaa4da73 100644 --- a/AssociationRegistry.sln +++ b/AssociationRegistry.sln @@ -113,6 +113,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GeefOndernemingResponses", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssociationRegistry.Hosts", "src\AssociationRegistry.Hosts\AssociationRegistry.Hosts.csproj", "{F0853B2C-FEAB-4ACF-92D5-D9FBC3DA1427}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".aws", ".aws", "{903553F6-3DDD-42F9-8B15-8BDEE66A685F}" + ProjectSection(SolutionItems) = preProject + .aws\Dockerfile = .aws\Dockerfile + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{91AC2AEF-D450-4257-B81A-2D6A6CB2D848}" + ProjectSection(SolutionItems) = preProject + .aws\scripts\ecs-desired-count.sh = .aws\scripts\ecs-desired-count.sh + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -211,5 +221,7 @@ Global {85139412-485D-4B23-8423-A0C2021B60DE} = {1157AB42-EACF-454D-92D5-DBA9FF3D0E24} {9C2CDA4C-FFF3-4AA1-B31A-8804D98F0469} = {A30C8928-5F0D-459A-BB1B-0AE24A160CBB} {F0853B2C-FEAB-4ACF-92D5-D9FBC3DA1427} = {20B970CD-1737-4427-A924-D299A42346FE} + {903553F6-3DDD-42F9-8B15-8BDEE66A685F} = {C9AFE263-FC5F-4243-BC1F-737B0CCB6DE6} + {91AC2AEF-D450-4257-B81A-2D6A6CB2D848} = {903553F6-3DDD-42F9-8B15-8BDEE66A685F} EndGlobalSection EndGlobal From 5cee74082c357e488ec5e1e465a4a735c99160cc Mon Sep 17 00:00:00 2001 From: Jan Lesage Date: Thu, 21 Dec 2023 15:34:11 +0100 Subject: [PATCH 3/8] chore: remove dynamodb locks from lock tables --- .aws/Dockerfile | 10 +- .aws/init.sh | 86 ++++++++++++++++ .aws/scripts/ecs-desired-count.sh | 75 -------------- .github/build-scripts/build-docker.sh | 18 ++++ association-registry.sln | 137 ++++++++++++++++++++++++++ 5 files changed, 246 insertions(+), 80 deletions(-) create mode 100644 .aws/init.sh delete mode 100755 .aws/scripts/ecs-desired-count.sh create mode 100644 .github/build-scripts/build-docker.sh create mode 100644 association-registry.sln diff --git a/.aws/Dockerfile b/.aws/Dockerfile index 1ec4821a2..ccc305723 100644 --- a/.aws/Dockerfile +++ b/.aws/Dockerfile @@ -1,11 +1,11 @@ FROM public.ecr.aws/aws-cli/aws-cli:2.15.2 -RUN yum install -y bash +LABEL maintainer="Digitaal Vlaanderen " +LABEL registry="association-registry" +COPY .aws/ /app WORKDIR /app -COPY scripts/ecs-desired-count.sh . - -RUN chmod +x ./ecs-desired-count.sh +RUN yum install -y bash -ENTRYPOINT ["./ecs-desired-count.sh"] \ No newline at end of file +ENTRYPOINT ["./init.sh"] \ No newline at end of file diff --git a/.aws/init.sh b/.aws/init.sh new file mode 100644 index 000000000..ffe3d4356 --- /dev/null +++ b/.aws/init.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +# Function to update the desired count of a service +update_service_count() { + local cluster=$1 + local service=$2 + local count=$3 + SILENT_OUTPUT=`aws ecs update-service --cluster "$cluster" --service "$service" --desired-count "$count"` +} + +# Function to wait for the desired count to be reached +wait_for_desired_count() { + local cluster=$1 + local service=$2 + local desired_count=$3 + + while :; do + current_count=`aws ecs describe-services --cluster "$cluster" --services "$service" --query "services[0].runningCount" --output text` + if [[ "$current_count" -eq "$desired_count" ]]; then + break + else + sleep 5 + fi + done +} + +# Check for minimum required parameters: at least one service name +# if [ "$#" -lt 1 ]; then +# echo "Usage: $0 service1 [service2 ...]" +# exit 1 +# fi + +# Disable CLI paging for this script +export AWS_PAGER="" + +# First argument is the cluster, the rest are services +CLUSTER_ARN=`aws ecs list-clusters --query "clusterArns[0]" --output text` +echo "Found ECS cluster: $CLUSTER_ARN" + +SERVICES=`aws ecs list-services --cluster $CLUSTER_ARN --query "serviceArns[]"` +echo "Found ECS services: $SERVICES" +SERVICES=`aws ecs list-services --cluster $CLUSTER_ARN --query "serviceArns[]" --output text` + +declare -A original_counts + +# Get the original desired counts and downscale services +for serviceArn in $SERVICES; do + original_count=`aws ecs describe-services --cluster "$CLUSTER_ARN" --services "$serviceArn" --query "services[0].desiredCount" --output text` + echo "Found desired count for service $serviceArn: $original_count" + original_counts["$serviceArn"]=$original_count + update_service_count "$CLUSTER_ARN" "$serviceArn" 0 +done + +# Wait for services to be downscaled +for serviceArn in $SERVICES; do + wait_for_desired_count "$CLUSTER_ARN" "$serviceArn" 0 + echo "Downscaled desired count for service $serviceArn" +done + +DYNAMODB_TABLES=`aws dynamodb list-tables --query TableNames[]` +echo "Found DynamoDB tables: $DYNAMODB_TABLES" +DYNAMODB_TABLES=`aws dynamodb list-tables --query TableNames[] --output text` + +for tableName in $DYNAMODB_TABLES; do + if [[ "$tableName" == *"-lock"* ]]; then + itemName=`aws dynamodb scan --table-name "$tableName" --query Items[0].resourceId.S --output text` + if ! [[ "$itemName" == "None" ]]; then + echo "Found $itemName inside $tableName which will be removed" + aws dynamodb delete-item --table-name $tableName --key '{"resourceId": {"S": "'$itemName'"}}' + fi + fi +done + +# Restore original desired counts +for service in $SERVICES; do + original_count=${original_counts["$service"]} + update_service_count "$CLUSTER_ARN" "$service" $original_count + echo "Restored desired count for service $serviceArn: $original_count" +done + +for service in $SERVICES; do + update_service_count "$CLUSTER_ARN" "$service" 1 +done + +echo "" +echo "Done." \ No newline at end of file diff --git a/.aws/scripts/ecs-desired-count.sh b/.aws/scripts/ecs-desired-count.sh deleted file mode 100755 index 8cecd7b24..000000000 --- a/.aws/scripts/ecs-desired-count.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -# Function to update the desired count of a service -update_service_count() { - local cluster=$1 - local service=$2 - local count=$3 - echo "Updating $service to desired count: $count" - aws ecs update-service --cluster "$cluster" --service "$service" --desired-count "$count" -} - -# Function to wait for the desired count to be reached -wait_for_desired_count() { - local cluster=$1 - local service=$2 - local desired_count=$3 - - echo "Waiting for $service to reach desired count: $desired_count" - while :; do - current_count=$(aws ecs describe-services --cluster "$cluster" --services "$service" --query "services[0].runningCount" --output text) - if [[ "$current_count" -eq "$desired_count" ]]; then - echo "$service has reached the desired count: $desired_count" - break - else - echo "Current count for $service is $current_count. Waiting..." - sleep 10 - fi - done -} - -# Check for minimum required parameters: at least one service name -if [ "$#" -lt 2 ]; then - echo "Usage: $0 cluster-name service1 [service2 ...]" - exit 1 -fi - -# Disable CLI paging for this script -export AWS_PAGER="" - -# First argument is the cluster, the rest are services -CLUSTER_ARN=$1 -shift -SERVICES=("$@") - -# Associative array to store original desired counts -declare -A original_counts - -# Get the original desired counts and downscale services -for service in "${SERVICES[@]}"; do - original_count=$(aws ecs describe-services --cluster "$CLUSTER_ARN" --services "$service" --query "services[0].desiredCount" --output text) - original_counts["$service"]=$original_count - update_service_count "$CLUSTER_ARN" "$service" 0 -done - -for service in "${SERVICES[@]}"; do - original_count=$(aws ecs describe-services --cluster "$CLUSTER_ARN" --services "$service" --query "services[0].desiredCount" --output text) - original_counts["$service"]=$original_count - wait_for_desired_count "$CLUSTER_ARN" "$service" 0 -done - -# Main script operations -# Place any operations you need to perform while the services are downscaled here - -# Restore services to their original desired counts -for service in "${SERVICES[@]}"; do - original_count=${original_counts["$service"]} - update_service_count "$CLUSTER_ARN" "$service" "$original_count" -done - -for service in "${SERVICES[@]}"; do - original_count=${original_counts["$service"]} - wait_for_desired_count "$CLUSTER_ARN" "$service" "$original_count" -done - -echo "All services have been restored to their original scaling." diff --git a/.github/build-scripts/build-docker.sh b/.github/build-scripts/build-docker.sh new file mode 100644 index 000000000..8871d48fa --- /dev/null +++ b/.github/build-scripts/build-docker.sh @@ -0,0 +1,18 @@ +# Set up the docker build command +dockerRegistry="${BUILD_DOCKER_REGISTRY:-dev.local}" +containerName=$1 +buildNumber="${CI_BUILD_NUMBER:-0.0.0}" + +docker_cmd="docker build . --file .aws/Dockerfile --no-cache --tag $dockerRegistry/$containerName:$buildNumber --build-arg build_number=$buildNumber" + +# Run the docker build command, and storeit's result +$docker_cmd +result=$? + +if [ $? -eq 0 ]; then + echo "Docker build succeeded!" +else + echo "Docker build failed or timed out!" +fi + +exit $result diff --git a/association-registry.sln b/association-registry.sln new file mode 100644 index 000000000..10d6842c4 --- /dev/null +++ b/association-registry.sln @@ -0,0 +1,137 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{96D95D7E-E044-49D2-88A6-E598E4FACAB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry", "src\AssociationRegistry\AssociationRegistry.csproj", "{22F60876-3C7E-4A6F-A003-3F7148CEFB79}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Acm.Api", "src\AssociationRegistry.Acm.Api\AssociationRegistry.Acm.Api.csproj", "{CFD9318C-196E-4820-8C0E-B164A3266E02}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Acm.Schema", "src\AssociationRegistry.Acm.Schema\AssociationRegistry.Acm.Schema.csproj", "{99DD0631-DD63-4893-B221-F5E8F6C20E68}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Admin.Api", "src\AssociationRegistry.Admin.Api\AssociationRegistry.Admin.Api.csproj", "{B1129A9F-153A-4861-ACB6-8188EEF7166C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Admin.ProjectionHost", "src\AssociationRegistry.Admin.ProjectionHost\AssociationRegistry.Admin.ProjectionHost.csproj", "{B573A400-609C-490D-B2E1-0D0CB3FEF92D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Admin.Schema", "src\AssociationRegistry.Admin.Schema\AssociationRegistry.Admin.Schema.csproj", "{75A01E68-4BAE-45BF-A67A-A0DC4992E594}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Hosts", "src\AssociationRegistry.Hosts\AssociationRegistry.Hosts.csproj", "{4CFFC147-8956-42AF-A0C5-941FEAF42F67}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Magda", "src\AssociationRegistry.Magda\AssociationRegistry.Magda.csproj", "{0493D9E8-B750-48D3-8754-1D67B279077D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.OpenTelemetry", "src\AssociationRegistry.OpenTelemetry\AssociationRegistry.OpenTelemetry.csproj", "{88786343-0C25-4BD9-93F5-4DF2117FF20C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Public.Api", "src\AssociationRegistry.Public.Api\AssociationRegistry.Public.Api.csproj", "{50AA8D32-F4FA-41D8-B39C-E17731E6A773}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Public.ProjectionHost", "src\AssociationRegistry.Public.ProjectionHost\AssociationRegistry.Public.ProjectionHost.csproj", "{0B241A7B-5575-4FA9-9A5F-A985BAD5F500}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Public.Schema", "src\AssociationRegistry.Public.Schema\AssociationRegistry.Public.Schema.csproj", "{B71D4D89-2F06-460C-8B05-AD206D876549}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{25D346A4-E7F4-4887-95C4-A7F957DBC232}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Test", "test\AssociationRegistry.Test\AssociationRegistry.Test.csproj", "{A466EC7B-F166-48E1-B0E6-92858BBB2647}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Test.Acm.Api", "test\AssociationRegistry.Test.Acm.Api\AssociationRegistry.Test.Acm.Api.csproj", "{C00AA6C1-989A-4370-8115-6FDBCCAD1CCF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Test.Admin.Api", "test\AssociationRegistry.Test.Admin.Api\AssociationRegistry.Test.Admin.Api.csproj", "{E8E9BD93-4E8E-4E01-A3F8-5E9B4F823CDA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssociationRegistry.Test.Public.Api", "test\AssociationRegistry.Test.Public.Api\AssociationRegistry.Test.Public.Api.csproj", "{9004701E-95EE-42AF-856C-F9CC8083852A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {22F60876-3C7E-4A6F-A003-3F7148CEFB79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22F60876-3C7E-4A6F-A003-3F7148CEFB79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22F60876-3C7E-4A6F-A003-3F7148CEFB79}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22F60876-3C7E-4A6F-A003-3F7148CEFB79}.Release|Any CPU.Build.0 = Release|Any CPU + {CFD9318C-196E-4820-8C0E-B164A3266E02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFD9318C-196E-4820-8C0E-B164A3266E02}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFD9318C-196E-4820-8C0E-B164A3266E02}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFD9318C-196E-4820-8C0E-B164A3266E02}.Release|Any CPU.Build.0 = Release|Any CPU + {99DD0631-DD63-4893-B221-F5E8F6C20E68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99DD0631-DD63-4893-B221-F5E8F6C20E68}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99DD0631-DD63-4893-B221-F5E8F6C20E68}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99DD0631-DD63-4893-B221-F5E8F6C20E68}.Release|Any CPU.Build.0 = Release|Any CPU + {B1129A9F-153A-4861-ACB6-8188EEF7166C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1129A9F-153A-4861-ACB6-8188EEF7166C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1129A9F-153A-4861-ACB6-8188EEF7166C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1129A9F-153A-4861-ACB6-8188EEF7166C}.Release|Any CPU.Build.0 = Release|Any CPU + {B573A400-609C-490D-B2E1-0D0CB3FEF92D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B573A400-609C-490D-B2E1-0D0CB3FEF92D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B573A400-609C-490D-B2E1-0D0CB3FEF92D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B573A400-609C-490D-B2E1-0D0CB3FEF92D}.Release|Any CPU.Build.0 = Release|Any CPU + {75A01E68-4BAE-45BF-A67A-A0DC4992E594}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {75A01E68-4BAE-45BF-A67A-A0DC4992E594}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75A01E68-4BAE-45BF-A67A-A0DC4992E594}.Release|Any CPU.ActiveCfg = Release|Any CPU + {75A01E68-4BAE-45BF-A67A-A0DC4992E594}.Release|Any CPU.Build.0 = Release|Any CPU + {4CFFC147-8956-42AF-A0C5-941FEAF42F67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CFFC147-8956-42AF-A0C5-941FEAF42F67}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CFFC147-8956-42AF-A0C5-941FEAF42F67}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CFFC147-8956-42AF-A0C5-941FEAF42F67}.Release|Any CPU.Build.0 = Release|Any CPU + {0493D9E8-B750-48D3-8754-1D67B279077D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0493D9E8-B750-48D3-8754-1D67B279077D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0493D9E8-B750-48D3-8754-1D67B279077D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0493D9E8-B750-48D3-8754-1D67B279077D}.Release|Any CPU.Build.0 = Release|Any CPU + {88786343-0C25-4BD9-93F5-4DF2117FF20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88786343-0C25-4BD9-93F5-4DF2117FF20C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88786343-0C25-4BD9-93F5-4DF2117FF20C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88786343-0C25-4BD9-93F5-4DF2117FF20C}.Release|Any CPU.Build.0 = Release|Any CPU + {50AA8D32-F4FA-41D8-B39C-E17731E6A773}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50AA8D32-F4FA-41D8-B39C-E17731E6A773}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50AA8D32-F4FA-41D8-B39C-E17731E6A773}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50AA8D32-F4FA-41D8-B39C-E17731E6A773}.Release|Any CPU.Build.0 = Release|Any CPU + {0B241A7B-5575-4FA9-9A5F-A985BAD5F500}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B241A7B-5575-4FA9-9A5F-A985BAD5F500}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B241A7B-5575-4FA9-9A5F-A985BAD5F500}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B241A7B-5575-4FA9-9A5F-A985BAD5F500}.Release|Any CPU.Build.0 = Release|Any CPU + {B71D4D89-2F06-460C-8B05-AD206D876549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B71D4D89-2F06-460C-8B05-AD206D876549}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B71D4D89-2F06-460C-8B05-AD206D876549}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B71D4D89-2F06-460C-8B05-AD206D876549}.Release|Any CPU.Build.0 = Release|Any CPU + {A466EC7B-F166-48E1-B0E6-92858BBB2647}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A466EC7B-F166-48E1-B0E6-92858BBB2647}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A466EC7B-F166-48E1-B0E6-92858BBB2647}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A466EC7B-F166-48E1-B0E6-92858BBB2647}.Release|Any CPU.Build.0 = Release|Any CPU + {C00AA6C1-989A-4370-8115-6FDBCCAD1CCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C00AA6C1-989A-4370-8115-6FDBCCAD1CCF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C00AA6C1-989A-4370-8115-6FDBCCAD1CCF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C00AA6C1-989A-4370-8115-6FDBCCAD1CCF}.Release|Any CPU.Build.0 = Release|Any CPU + {E8E9BD93-4E8E-4E01-A3F8-5E9B4F823CDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8E9BD93-4E8E-4E01-A3F8-5E9B4F823CDA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8E9BD93-4E8E-4E01-A3F8-5E9B4F823CDA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8E9BD93-4E8E-4E01-A3F8-5E9B4F823CDA}.Release|Any CPU.Build.0 = Release|Any CPU + {9004701E-95EE-42AF-856C-F9CC8083852A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9004701E-95EE-42AF-856C-F9CC8083852A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9004701E-95EE-42AF-856C-F9CC8083852A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9004701E-95EE-42AF-856C-F9CC8083852A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {22F60876-3C7E-4A6F-A003-3F7148CEFB79} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {CFD9318C-196E-4820-8C0E-B164A3266E02} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {99DD0631-DD63-4893-B221-F5E8F6C20E68} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {B1129A9F-153A-4861-ACB6-8188EEF7166C} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {B573A400-609C-490D-B2E1-0D0CB3FEF92D} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {75A01E68-4BAE-45BF-A67A-A0DC4992E594} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {4CFFC147-8956-42AF-A0C5-941FEAF42F67} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {0493D9E8-B750-48D3-8754-1D67B279077D} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {88786343-0C25-4BD9-93F5-4DF2117FF20C} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {50AA8D32-F4FA-41D8-B39C-E17731E6A773} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {0B241A7B-5575-4FA9-9A5F-A985BAD5F500} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {B71D4D89-2F06-460C-8B05-AD206D876549} = {96D95D7E-E044-49D2-88A6-E598E4FACAB6} + {A466EC7B-F166-48E1-B0E6-92858BBB2647} = {25D346A4-E7F4-4887-95C4-A7F957DBC232} + {C00AA6C1-989A-4370-8115-6FDBCCAD1CCF} = {25D346A4-E7F4-4887-95C4-A7F957DBC232} + {E8E9BD93-4E8E-4E01-A3F8-5E9B4F823CDA} = {25D346A4-E7F4-4887-95C4-A7F957DBC232} + {9004701E-95EE-42AF-856C-F9CC8083852A} = {25D346A4-E7F4-4887-95C4-A7F957DBC232} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6EB621BB-0C7F-4F84-97EE-5E4E20951BBA} + EndGlobalSection +EndGlobal From 13233760b8f19a4b354d8e7882dff0e927570205 Mon Sep 17 00:00:00 2001 From: Koen Metsu Date: Fri, 22 Dec 2023 10:27:32 +0100 Subject: [PATCH 4/8] feat: or-1349 delete es indices --- .aws/Dockerfile | 2 +- .aws/init.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) mode change 100644 => 100755 .aws/init.sh diff --git a/.aws/Dockerfile b/.aws/Dockerfile index ccc305723..2484c4d8e 100644 --- a/.aws/Dockerfile +++ b/.aws/Dockerfile @@ -6,6 +6,6 @@ LABEL registry="association-registry" COPY .aws/ /app WORKDIR /app -RUN yum install -y bash +RUN yum install -y bash curl ENTRYPOINT ["./init.sh"] \ No newline at end of file diff --git a/.aws/init.sh b/.aws/init.sh old mode 100644 new mode 100755 index ffe3d4356..f1ea9cb7e --- a/.aws/init.sh +++ b/.aws/init.sh @@ -57,6 +57,7 @@ for serviceArn in $SERVICES; do echo "Downscaled desired count for service $serviceArn" done +# Clear DynamoDB Locks DYNAMODB_TABLES=`aws dynamodb list-tables --query TableNames[]` echo "Found DynamoDB tables: $DYNAMODB_TABLES" DYNAMODB_TABLES=`aws dynamodb list-tables --query TableNames[] --output text` @@ -71,6 +72,33 @@ for tableName in $DYNAMODB_TABLES; do fi done +# Clear Elasticsearch Indices +# Elasticsearch endpoint +ES_ENDPOINT="${ES_HOST}" + +# Authentication credentials from environment variables +ES_USERNAME="${ES_USERNAME}" +ES_PASSWORD="${ES_PASSWORD}" + +# Base64 encode the credentials +AUTH=$(echo -n "$ES_USERNAME:$ES_PASSWORD" | base64) + +# Query Elasticsearch for indices starting with 'verenigingsregister-' +INDICES=$(curl -s -X GET "$ES_ENDPOINT/_cat/indices/verenigingsregister-*?h=index" -H "Authorization: Basic $AUTH") + +echo "Found ElasticSearch indices: $INDICES" + +# Loop through the indices and delete them +for index in $INDICES; do + echo "Deleting index: $index" + RESPONSE=$(curl -s -X DELETE "$ES_ENDPOINT/$index" -H "Authorization: Basic $AUTH") + echo "Response: $RESPONSE" +done + +echo "Deletion process completed." + +# Reset database + # Restore original desired counts for service in $SERVICES; do original_count=${original_counts["$service"]} From b8665953444773ea5e8a2a646712b095a8bda028 Mon Sep 17 00:00:00 2001 From: Koen Metsu Date: Fri, 22 Dec 2023 10:54:31 +0100 Subject: [PATCH 5/8] feat: or-1349 always restore services --- .aws/init.sh | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.aws/init.sh b/.aws/init.sh index f1ea9cb7e..9a79d89c8 100755 --- a/.aws/init.sh +++ b/.aws/init.sh @@ -30,6 +30,27 @@ wait_for_desired_count() { # exit 1 # fi +cleanup() { + # Restore original desired counts + for service in $SERVICES; do + original_count=${original_counts["$service"]} + update_service_count "$CLUSTER_ARN" "$service" $original_count + echo "Restored desired count for service $serviceArn: $original_count" + done + + for service in $SERVICES; do + original_count=${original_counts["$service"]} + wait_for_desired_count "$CLUSTER_ARN" "$service" $original_count + echo "Desired count restored for service $serviceArn: $original_count" + done + + echo "" + echo "Done." +} + +# Set trap to call cleanup function on exit +trap cleanup EXIT + # Disable CLI paging for this script export AWS_PAGER="" @@ -99,16 +120,3 @@ echo "Deletion process completed." # Reset database -# Restore original desired counts -for service in $SERVICES; do - original_count=${original_counts["$service"]} - update_service_count "$CLUSTER_ARN" "$service" $original_count - echo "Restored desired count for service $serviceArn: $original_count" -done - -for service in $SERVICES; do - update_service_count "$CLUSTER_ARN" "$service" 1 -done - -echo "" -echo "Done." \ No newline at end of file From 771457c002efe1d1cc91f01054a13ac397ec6e1c Mon Sep 17 00:00:00 2001 From: Jan Lesage Date: Fri, 22 Dec 2023 11:40:19 +0100 Subject: [PATCH 6/8] chore: add postgres reset scripts --- .aws/db-privilege-grants.sql | 5 + .aws/db-recreate.sql | 4 + .aws/init.sh | 180 ++++++++++++++++++----------------- 3 files changed, 101 insertions(+), 88 deletions(-) create mode 100644 .aws/db-privilege-grants.sql create mode 100644 .aws/db-recreate.sql diff --git a/.aws/db-privilege-grants.sql b/.aws/db-privilege-grants.sql new file mode 100644 index 000000000..9d9ba9823 --- /dev/null +++ b/.aws/db-privilege-grants.sql @@ -0,0 +1,5 @@ +GRANT CONNECT ON DATABASE verenigingsregister TO fullaccess; +GRANT USAGE ON SCHEMA public TO fullaccess; +GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO fullaccess; +GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO fullaccess; +GRANT INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO fullaccess; \ No newline at end of file diff --git a/.aws/db-recreate.sql b/.aws/db-recreate.sql new file mode 100644 index 000000000..cbcac93e9 --- /dev/null +++ b/.aws/db-recreate.sql @@ -0,0 +1,4 @@ +drop database if exists verenigingsregister with (force); +create database verenigingsregister; + +grant all privileges on database verenigingsregister to verenigingsregister; diff --git a/.aws/init.sh b/.aws/init.sh index 9a79d89c8..51d0cdd5b 100755 --- a/.aws/init.sh +++ b/.aws/init.sh @@ -30,93 +30,97 @@ wait_for_desired_count() { # exit 1 # fi -cleanup() { - # Restore original desired counts - for service in $SERVICES; do - original_count=${original_counts["$service"]} - update_service_count "$CLUSTER_ARN" "$service" $original_count - echo "Restored desired count for service $serviceArn: $original_count" - done - - for service in $SERVICES; do - original_count=${original_counts["$service"]} - wait_for_desired_count "$CLUSTER_ARN" "$service" $original_count - echo "Desired count restored for service $serviceArn: $original_count" - done - - echo "" - echo "Done." -} - -# Set trap to call cleanup function on exit -trap cleanup EXIT - -# Disable CLI paging for this script -export AWS_PAGER="" - -# First argument is the cluster, the rest are services -CLUSTER_ARN=`aws ecs list-clusters --query "clusterArns[0]" --output text` -echo "Found ECS cluster: $CLUSTER_ARN" - -SERVICES=`aws ecs list-services --cluster $CLUSTER_ARN --query "serviceArns[]"` -echo "Found ECS services: $SERVICES" -SERVICES=`aws ecs list-services --cluster $CLUSTER_ARN --query "serviceArns[]" --output text` - -declare -A original_counts - -# Get the original desired counts and downscale services -for serviceArn in $SERVICES; do - original_count=`aws ecs describe-services --cluster "$CLUSTER_ARN" --services "$serviceArn" --query "services[0].desiredCount" --output text` - echo "Found desired count for service $serviceArn: $original_count" - original_counts["$serviceArn"]=$original_count - update_service_count "$CLUSTER_ARN" "$serviceArn" 0 -done - -# Wait for services to be downscaled -for serviceArn in $SERVICES; do - wait_for_desired_count "$CLUSTER_ARN" "$serviceArn" 0 - echo "Downscaled desired count for service $serviceArn" -done - -# Clear DynamoDB Locks -DYNAMODB_TABLES=`aws dynamodb list-tables --query TableNames[]` -echo "Found DynamoDB tables: $DYNAMODB_TABLES" -DYNAMODB_TABLES=`aws dynamodb list-tables --query TableNames[] --output text` - -for tableName in $DYNAMODB_TABLES; do - if [[ "$tableName" == *"-lock"* ]]; then - itemName=`aws dynamodb scan --table-name "$tableName" --query Items[0].resourceId.S --output text` - if ! [[ "$itemName" == "None" ]]; then - echo "Found $itemName inside $tableName which will be removed" - aws dynamodb delete-item --table-name $tableName --key '{"resourceId": {"S": "'$itemName'"}}' - fi - fi -done - -# Clear Elasticsearch Indices -# Elasticsearch endpoint -ES_ENDPOINT="${ES_HOST}" - -# Authentication credentials from environment variables -ES_USERNAME="${ES_USERNAME}" -ES_PASSWORD="${ES_PASSWORD}" - -# Base64 encode the credentials -AUTH=$(echo -n "$ES_USERNAME:$ES_PASSWORD" | base64) - -# Query Elasticsearch for indices starting with 'verenigingsregister-' -INDICES=$(curl -s -X GET "$ES_ENDPOINT/_cat/indices/verenigingsregister-*?h=index" -H "Authorization: Basic $AUTH") - -echo "Found ElasticSearch indices: $INDICES" - -# Loop through the indices and delete them -for index in $INDICES; do - echo "Deleting index: $index" - RESPONSE=$(curl -s -X DELETE "$ES_ENDPOINT/$index" -H "Authorization: Basic $AUTH") - echo "Response: $RESPONSE" -done - -echo "Deletion process completed." +# cleanup() { +# # Restore original desired counts +# for service in $SERVICES; do +# original_count=${original_counts["$service"]} +# update_service_count "$CLUSTER_ARN" "$service" $original_count +# echo "Restored desired count for service $serviceArn: $original_count" +# done + +# for service in $SERVICES; do +# original_count=${original_counts["$service"]} +# wait_for_desired_count "$CLUSTER_ARN" "$service" $original_count +# echo "Desired count restored for service $serviceArn: $original_count" +# done + +# echo "" +# echo "Done." +# } + +# # Set trap to call cleanup function on exit +# trap cleanup EXIT + +# # Disable CLI paging for this script +# export AWS_PAGER="" + +# # First argument is the cluster, the rest are services +# CLUSTER_ARN=`aws ecs list-clusters --query "clusterArns[0]" --output text` +# echo "Found ECS cluster: $CLUSTER_ARN" + +# SERVICES=`aws ecs list-services --cluster $CLUSTER_ARN --query "serviceArns[]"` +# echo "Found ECS services: $SERVICES" +# SERVICES=`aws ecs list-services --cluster $CLUSTER_ARN --query "serviceArns[]" --output text` + +# declare -A original_counts + +# # Get the original desired counts and downscale services +# for serviceArn in $SERVICES; do +# original_count=`aws ecs describe-services --cluster "$CLUSTER_ARN" --services "$serviceArn" --query "services[0].desiredCount" --output text` +# echo "Found desired count for service $serviceArn: $original_count" +# original_counts["$serviceArn"]=$original_count +# update_service_count "$CLUSTER_ARN" "$serviceArn" 0 +# done + +# # Wait for services to be downscaled +# for serviceArn in $SERVICES; do +# wait_for_desired_count "$CLUSTER_ARN" "$serviceArn" 0 +# echo "Downscaled desired count for service $serviceArn" +# done + +# # Clear DynamoDB Locks +# DYNAMODB_TABLES=`aws dynamodb list-tables --query TableNames[]` +# echo "Found DynamoDB tables: $DYNAMODB_TABLES" +# DYNAMODB_TABLES=`aws dynamodb list-tables --query TableNames[] --output text` + +# for tableName in $DYNAMODB_TABLES; do +# if [[ "$tableName" == *"-lock"* ]]; then +# itemName=`aws dynamodb scan --table-name "$tableName" --query Items[0].resourceId.S --output text` +# if ! [[ "$itemName" == "None" ]]; then +# echo "Found $itemName inside $tableName which will be removed" +# aws dynamodb delete-item --table-name $tableName --key '{"resourceId": {"S": "'$itemName'"}}' +# fi +# fi +# done + +# # Clear Elasticsearch Indices +# # Elasticsearch endpoint +# ES_ENDPOINT="${ES_HOST}" + +# # Authentication credentials from environment variables +# ES_USERNAME="${ES_USERNAME}" +# ES_PASSWORD="${ES_PASSWORD}" + +# # Base64 encode the credentials +# AUTH=$(echo -n "$ES_USERNAME:$ES_PASSWORD" | base64) + +# # Query Elasticsearch for indices starting with 'verenigingsregister-' +# INDICES=$(curl -s -X GET "$ES_ENDPOINT/_cat/indices/verenigingsregister-*?h=index" -H "Authorization: Basic $AUTH") + +# echo "Found ElasticSearch indices: $INDICES" + +# # Loop through the indices and delete them +# for index in $INDICES; do +# echo "Deleting index: $index" +# RESPONSE=$(curl -s -X DELETE "$ES_ENDPOINT/$index" -H "Authorization: Basic $AUTH") +# echo "Response: $RESPONSE" +# done + +# echo "Deletion process completed." + +POSTGRES_USERNAME="root" +POSTGRES_PASSWORD="root" # Reset database - +psql -U $POSTGRES_USERNAME -d postgres -f db-recreate.sql -W $POSTGRES_PASSWORD +psql -U $POSTGRES_USERNAME -d verenigingsregister -f db-privilege-grants.sql -W $POSTGRES_PASSWORD From 5f640dbcd067ede98ae9253ffa1b35e169d2b3d5 Mon Sep 17 00:00:00 2001 From: Koen Metsu Date: Thu, 4 Jan 2024 14:30:17 +0100 Subject: [PATCH 7/8] feat: or-1349 add postgres reset scripts --- .aws/{db-recreate.sql => 1.db-recreate.sql} | 2 +- ...-privilege-grants.sql => 2.db-privilege-grants.sql} | 2 +- .aws/Dockerfile | 10 +++++++--- .aws/init.sh | 7 ++----- 4 files changed, 11 insertions(+), 10 deletions(-) rename .aws/{db-recreate.sql => 1.db-recreate.sql} (92%) rename .aws/{db-privilege-grants.sql => 2.db-privilege-grants.sql} (87%) diff --git a/.aws/db-recreate.sql b/.aws/1.db-recreate.sql similarity index 92% rename from .aws/db-recreate.sql rename to .aws/1.db-recreate.sql index cbcac93e9..1782efdd0 100644 --- a/.aws/db-recreate.sql +++ b/.aws/1.db-recreate.sql @@ -1,4 +1,4 @@ drop database if exists verenigingsregister with (force); create database verenigingsregister; -grant all privileges on database verenigingsregister to verenigingsregister; +grant all privileges on database verenigingsregister to verenigingsregister; \ No newline at end of file diff --git a/.aws/db-privilege-grants.sql b/.aws/2.db-privilege-grants.sql similarity index 87% rename from .aws/db-privilege-grants.sql rename to .aws/2.db-privilege-grants.sql index 9d9ba9823..6fb36076e 100644 --- a/.aws/db-privilege-grants.sql +++ b/.aws/2.db-privilege-grants.sql @@ -2,4 +2,4 @@ GRANT CONNECT ON DATABASE verenigingsregister TO fullaccess; GRANT USAGE ON SCHEMA public TO fullaccess; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO fullaccess; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO fullaccess; -GRANT INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO fullaccess; \ No newline at end of file +GRANT INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO fullaccess; diff --git a/.aws/Dockerfile b/.aws/Dockerfile index 2484c4d8e..d396bcd26 100644 --- a/.aws/Dockerfile +++ b/.aws/Dockerfile @@ -1,11 +1,15 @@ -FROM public.ecr.aws/aws-cli/aws-cli:2.15.2 +FROM postgres:14 LABEL maintainer="Digitaal Vlaanderen " LABEL registry="association-registry" +# Install the AWS CLI +RUN apt-get update +RUN apt-get install python3-pip pipx -y + +RUN pipx install awscli + COPY .aws/ /app WORKDIR /app -RUN yum install -y bash curl - ENTRYPOINT ["./init.sh"] \ No newline at end of file diff --git a/.aws/init.sh b/.aws/init.sh index 51d0cdd5b..3573000c1 100755 --- a/.aws/init.sh +++ b/.aws/init.sh @@ -118,9 +118,6 @@ wait_for_desired_count() { # echo "Deletion process completed." -POSTGRES_USERNAME="root" -POSTGRES_PASSWORD="root" - # Reset database -psql -U $POSTGRES_USERNAME -d postgres -f db-recreate.sql -W $POSTGRES_PASSWORD -psql -U $POSTGRES_USERNAME -d verenigingsregister -f db-privilege-grants.sql -W $POSTGRES_PASSWORD +PGPASSFILE=/root/.pgpass psql -h $PG_HOST -d $PG_DB -U $PG_USERNAME -f 1.db-recreate.sql +PGPASSFILE=/root/.pgpass psql -h $PG_HOST -d $PG_DB -U $PG_USERNAME -f 2.db-privilege-grants.sql From 09b196b0cbe3e3070b3e60b7a8df0409482e6047 Mon Sep 17 00:00:00 2001 From: Jan Lesage Date: Mon, 5 Feb 2024 13:54:20 +0100 Subject: [PATCH 8/8] chore: removed obsolete workflow --- .github/workflows/test-manual-ik4.yml | 46 --------------------------- 1 file changed, 46 deletions(-) delete mode 100644 .github/workflows/test-manual-ik4.yml diff --git a/.github/workflows/test-manual-ik4.yml b/.github/workflows/test-manual-ik4.yml deleted file mode 100644 index 7cacc6495..000000000 --- a/.github/workflows/test-manual-ik4.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Manual Deploy To Test (IK4) - -on: - workflow_dispatch: - inputs: - version: - description: 'Version (format: x.xxx.x, ie: 1.221.1)' - required: true - -jobs: - deployment: - environment: test_ik4 - runs-on: ubuntu-latest - strategy: - matrix: - services: - [ - 'acmapi', - 'publicapi', - 'publicprojections', - 'adminapi', - 'adminprojections', - ] - steps: - - name: CD - env: - BUILD_URL: ${{ secrets.VBR_AWS_BUILD_API }}/${{matrix.services}} - STATUS_URL: ${{ secrets.VBR_AWS_BUILD_STATUS_API }}/${{matrix.services}} - uses: informatievlaanderen/awscurl-polling-action/polling-action@main - with: - environment: test - version: ${{ github.event.inputs.version }} - status-url: $STATUS_URL - deploy-url: $BUILD_URL - access-key: ${{ secrets.VBR_AWS_BUILD_USER_ACCESS_KEY_ID_IK4 }} - secret-key: ${{ secrets.VBR_AWS_BUILD_USER_SECRET_ACCESS_KEY_IK4 }} - region: eu-west-1 - deploy-target: 'ecs_service' - interval: 2 - - name: output - shell: bash - if: always() - run: | - echo build-uuid: ${{ steps.awscurl-polling-action.outputs.build-uuid }} - echo Status: ${{ steps.awscurl-polling-action.outputs.status }} - echo ${{ steps.awscurl-polling-action.outputs.final-message }}