From 6014b2d346f90cb4a7219251cb4107eebe6d75d6 Mon Sep 17 00:00:00 2001 From: ayuki_j <19406594+ayuki-joto@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:42:50 +0900 Subject: [PATCH 1/3] feat: update decidim v0.28 --- lib/decidim-stack.ts | 5 ++ .../decidim-cfj-cdk.test.ts.snap | 56 +++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/lib/decidim-stack.ts b/lib/decidim-stack.ts index b292c54..8ad744b 100644 --- a/lib/decidim-stack.ts +++ b/lib/decidim-stack.ts @@ -411,6 +411,11 @@ export class DecidimStack extends cdk.Stack { id: 'MailDigestWeekly', command: ['bundle','exec', 'rake', 'decidim:mailers:notifications_digest_weekly'], scheduleExpression: 'cron(0 19 ? * 6 *)' + }, + { + id: 'UpdateActiveStep', + command: ['bundle','exec', 'rake', 'decidim_participatory_processes:change_active_step'], + scheduleExpression: 'cron(*/15 * * * ? *)' } ] diff --git a/test/__snapshots__/decidim-cfj-cdk.test.ts.snap b/test/__snapshots__/decidim-cfj-cdk.test.ts.snap index bf7b2bb..a678520 100644 --- a/test/__snapshots__/decidim-cfj-cdk.test.ts.snap +++ b/test/__snapshots__/decidim-cfj-cdk.test.ts.snap @@ -1098,6 +1098,62 @@ exports[`DecidimStack Created 1`] = ` }, "Type": "AWS::ElasticLoadBalancingV2::TargetGroup", }, + "UpdateActiveStep02E91CED": { + "Properties": { + "ScheduleExpression": "cron(*/15 * * * ? *)", + "State": "ENABLED", + "Targets": [ + { + "Arn": { + "Fn::GetAtt": [ + "DecidimCluster7E0E2A4C", + "Arn", + ], + }, + "EcsParameters": { + "LaunchType": "FARGATE", + "NetworkConfiguration": { + "AwsVpcConfiguration": { + "AssignPublicIp": "DISABLED", + "SecurityGroups": [ + { + "Fn::GetAtt": [ + "decidimTaskDefinitionSecurityGroup7C75DD43", + "GroupId", + ], + }, + ], + "Subnets": [ + { + "Fn::ImportValue": "stagingdecidimNetworkStack:ExportsOutputRefVpcpublicSubnet1Subnet2BB74ED74EB42ADC", + }, + { + "Fn::ImportValue": "stagingdecidimNetworkStack:ExportsOutputRefVpcpublicSubnet2SubnetE34B022AC8BB6627", + }, + { + "Fn::ImportValue": "stagingdecidimNetworkStack:ExportsOutputRefVpcpublicSubnet3SubnetDFEF064A56C3647E", + }, + ], + }, + }, + "TaskCount": 1, + "TaskDefinitionArn": { + "Ref": "decidimTaskDefinition2308FB5B", + }, + }, + "Id": "Target0", + "Input": "{"containerOverrides":[{"name":"appContainer","command":["bundle","exec","rake","decidim_participatory_processes:change_active_step"]}]}", + "RoleArn": { + "Fn::GetAtt": [ + "decidimTaskDefinitionEventsRole6CB2B894", + "Arn", + ], + }, + }, + ], + }, + "Type": "AWS::Events::Rule", + }, "addARecordA6D3D93D": { "DeletionPolicy": "Delete", "DependsOn": [ From bcf5f71ce18b35703d512c8b828ba2bde9793700 Mon Sep 17 00:00:00 2001 From: ayuki_j <19406594+ayuki-joto@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:47:08 +0900 Subject: [PATCH 2/3] refactor: add dev v028 json --- bin/decidim-cfj-cdk.ts | 2 +- config/{prd-v0265.json => dev-v028.json} | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) rename config/{prd-v0265.json => dev-v028.json} (74%) diff --git a/bin/decidim-cfj-cdk.ts b/bin/decidim-cfj-cdk.ts index 9b883b3..200fa73 100644 --- a/bin/decidim-cfj-cdk.ts +++ b/bin/decidim-cfj-cdk.ts @@ -12,7 +12,7 @@ import { Tags } from 'aws-cdk-lib'; const app = new cdk.App(); -const stages = ['dev', 'staging', 'prd-v0274'] +const stages = ['dev', 'staging', 'prd-v0274', 'dev-v028'] const stage = app.node.tryGetContext('stage') const tag = app.node.tryGetContext('tag') if (!stages.includes(stage)) { diff --git a/config/prd-v0265.json b/config/dev-v028.json similarity index 74% rename from config/prd-v0265.json rename to config/dev-v028.json index 3000e15..e875288 100644 --- a/config/prd-v0265.json +++ b/config/dev-v028.json @@ -1,13 +1,13 @@ { "rds": { "snapshot": true, - "snapshotIdentifier": "decidim-master-2023-04-03", - "instanceType": "t2.medium", - "deletionProtection": true, + "snapshotIdentifier": "decidim-master-2024-08-27", + "instanceType": "t3.micro", + "deletionProtection": false, "allocatedStorage": 20, "maxAllocatedStorage": 40, - "enablePerformanceInsights": true, - "multiAz": true + "enablePerformanceInsights": false, + "multiAz": false }, "aws": { @@ -17,9 +17,8 @@ "cacheNodeType": "cache.t2.micro", "engineVersion": "6.x", - "numCacheNodes": 3, - "automaticFailoverEnabled": true, - + "numCacheNodes": 1, + "automaticFailoverEnabled": false, "ecs": { "smtpDomain": "diycities.jp", "repository": "decidim-cfj", @@ -28,11 +27,12 @@ "arn:aws:acm:ap-northeast-1:887442827229:certificate/b02c7415-d6f8-4794-994e-fe5689ca7b74" ], "fargateSpotCapacityProvider": { + "base": 1, "weight": 1 }, "fargateCapacityProvider": { - "base": 1, - "weight": 2 + "base": 0, + "weight": 1 } }, From 27ca9022aa1d98cfddfd8641db3aba57a7195002 Mon Sep 17 00:00:00 2001 From: ayuki_j <19406594+ayuki-joto@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:47:40 +0900 Subject: [PATCH 3/3] refactor: fix docs --- docs/build_dev.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/build_dev.md b/docs/build_dev.md index 6ccd433..8acd198 100644 --- a/docs/build_dev.md +++ b/docs/build_dev.md @@ -115,13 +115,13 @@ $ npx cdk --context stage=dev tag=${IMAGE_TAG} --profile decidim bootstrap どんなリソースが作成されるのかを確認できる。 ```console -$ npx cdk --context stage=dev tag=${IMAGE_TAG} --profile decidim diff +$ npx cdk --context stage=dev -c tag=${IMAGE_TAG} --profile decidim diff ``` ## 6-3. デプロイ実行 ```console -$ npx cdk --context stage=dev tag=${IMAGE_TAG} --profile decidim deploy --all --require-approval never +$ npx cdk --context stage=dev -c tag=${IMAGE_TAG} --profile decidim deploy --all --require-approval never ``` 上記コマンドが成功すれば、デプロイは成功です。