Skip to content

Commit

Permalink
Merge pull request #38 from codeforjapan/refactor/remove-decidim-v026
Browse files Browse the repository at this point in the history
Refactor/remove decidim v026
  • Loading branch information
ayuki-joto authored Dec 15, 2023
2 parents 0009fba + 4c58bad commit 13f4b93
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev_synth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: youyo/aws-cdk-github-actions@v2
with:
cdk_subcommand: 'synth'
cdk_version: '2.102.0'
cdk_version: '2.115.0'
working_dir: 'cdk'
cdk_args: '--context stage=dev'
env:
Expand Down
2 changes: 1 addition & 1 deletion bin/decidim-cfj-cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Tags } from 'aws-cdk-lib';

const app = new cdk.App();

const stages = ['dev', 'staging', 'prd-v0265', 'prd-v0274']
const stages = ['dev', 'staging', 'prd-v0274']
const stage = app.node.tryGetContext('stage')
const tag = app.node.tryGetContext('tag')
if (!stages.includes(stage)) {
Expand Down
3 changes: 2 additions & 1 deletion docs/build_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ AWS Systems Manager のパラメータストアで以下のようなパラメー
/decidim-cfj/${props.stage}/NEW_RELIC_LICENSE_KEY
/decidim-cfj/${props.stage}/SMTP_ADDRESS
/decidim-cfj/${props.stage}/SMTP_USERNAME
/decidim-cfj/${props.stage}/SLACK_API_TOKEN
```

# 4. ECRの準備
Expand Down Expand Up @@ -103,7 +104,7 @@ $ npx cdk --context stage=dev tag=${IMAGE_TAG} --profile decidim deploy --all -

## 7.1 環境へのアクセス
```console
$ aws ecs execute-command --region ap-northeast-1 --cluster devDecidimCluster --task ${タスク名} --container appContainer --interactive --command "/bin/ash" --profile decidim
$ aws ecs execute-command --region ap-northeast-1 --cluster devDecidimCluster --task ${タスク名} --container appContainer --interactive --command "/bin/bash" --profile decidim
```

## 7.2 migrateとseedの実行
Expand Down
4 changes: 2 additions & 2 deletions lib/cloudfront.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class CloudFrontStack extends Stack {
}
]

if (props.stage === 'prd-v0265' || props.stage === 'prd-v0274') {
if (props.stage === 'prd-v0274') {
rules.push({
name: 'production-AllowSystemLogin',
priority: 7,
Expand Down Expand Up @@ -266,7 +266,7 @@ export class CloudFrontStack extends Stack {
}
)

if (props.stage === "prd-v0265" || props.stage === 'prd-v0274') {
if (props.stage === 'prd-v0274') {
new cloudfront.Distribution(this, 'Distribution', {
priceClass: cloudfront.PriceClass.PRICE_CLASS_ALL,
defaultBehavior: {
Expand Down
6 changes: 3 additions & 3 deletions lib/decidim-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ export class DecidimStack extends cdk.Stack {
image: new ecs.EcrImage(decidimRepository, props.tag),
environment: {
...DecidimContainerEnvironment, ...{
NEW_RELIC_AGENT_ENABLED: props.stage === 'prd-v0265' || props.stage === 'prd-v0274' ? 'true' : 'false',
NEW_RELIC_LICENSE_KEY: props.stage === 'prd-v0265' || props.stage === 'prd-v0274' ? ssm.StringParameter.valueForTypedStringParameterV2(this, `/decidim-cfj/${ props.stage }/NEW_RELIC_LICENSE_KEY`) : '',
NEW_RELIC_AGENT_ENABLED: props.stage === 'prd-v0274' ? 'true' : 'false',
NEW_RELIC_LICENSE_KEY: props.stage === 'prd-v0274' ? ssm.StringParameter.valueForTypedStringParameterV2(this, `/decidim-cfj/${ props.stage }/NEW_RELIC_LICENSE_KEY`) : '',
NEW_RELIC_APP_NAME: `decidim-app${ props.stage }`,
MAPS_PROVIDER: 'osm',
MAPS_STATIC_PROVIDER: 'cfj_osm',
Expand Down Expand Up @@ -273,7 +273,7 @@ export class DecidimStack extends cdk.Stack {
targetUtilizationPercent: 50
})
autoscaling.scaleOnMemoryUtilization('ScalingOnMemory', {
targetUtilizationPercent: 50
targetUtilizationPercent: 70
})

new ecs.FargateService(this, 'sidekiqService', {
Expand Down
2 changes: 1 addition & 1 deletion lib/elasticache-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ElasticacheStack extends Stack {
cacheSubnetGroupName: props.ecSubnetGroup.cacheSubnetGroupName,
}

if (props.stage === 'prd-v0265' || props.stage === 'prd-v0274') {
if (props.stage === 'prd-v0274') {
this.redis = new elasticache.CfnReplicationGroup(this, 'prdElasticache', {
...elastiCacheProps,
...{
Expand Down
2 changes: 1 addition & 1 deletion lib/s3-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class S3Stack extends Stack {

const bucket = new aws_s3.Bucket(this, 'createBucket', {
bucketName: `${ props.stage }-${ props.serviceName }-bucket`,
versioned: props.stage === "prd-v0265" || props.stage === 'prd-v0274',
versioned: props.stage === 'prd-v0274',
removalPolicy: RemovalPolicy.DESTROY,
autoDeleteObjects: true,
blockPublicAccess: aws_s3.BlockPublicAccess.BLOCK_ALL,
Expand Down
Loading

0 comments on commit 13f4b93

Please sign in to comment.