Skip to content

Commit 1bdab03

Browse files
clean up cicd script and template
1 parent 9e6620c commit 1bdab03

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

cicd/2-cicd/cicd.template.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ Parameters:
3535
Conditions:
3636
TargetsMainBranch: !Equals [ !Ref GitHubBranch, main ]
3737
DeployToAdhoc: !Equals [!Ref Mode, adhoc ]
38-
# DeployToTest and DeployToProd are the same right now
39-
DeployToTest: !Equals [!Ref Mode, standard ]
40-
DeployToProd: !Equals [ !Ref Mode, standard ]
38+
DeployToTestAndProd: !Equals [!Ref Mode, standard ]
4139

4240

4341
Resources:
@@ -269,7 +267,6 @@ Resources:
269267
ConnectionArn: !Sub arn:aws:codestar-connections:us-east-1:${AWS::AccountId}:connection/${CodeStarConnectionResourceId}
270268
FullRepositoryId: !Sub ${GitHubOwner}/${GitHubRepo}
271269
BranchName: !Ref GitHubBranch
272-
DetectChanges: true
273270

274271
- Name: Build
275272
Actions:
@@ -325,7 +322,7 @@ Resources:
325322
- !Ref AWS::NoValue
326323

327324
- !If
328-
- DeployToTest
325+
- DeployToTestAndProd
329326
- Name: Deploy_To_Test
330327
Actions:
331328
- Name: app-deploy
@@ -351,7 +348,7 @@ Resources:
351348
- !Ref AWS::NoValue
352349

353350
- !If
354-
- DeployToTest
351+
- DeployToTestAndProd
355352
- Name: Integration_Test
356353
Actions:
357354
- Name: integration-test
@@ -373,7 +370,7 @@ Resources:
373370
- !Ref AWS::NoValue
374371

375372
- !If
376-
- DeployToProd
373+
- DeployToTestAndProd
377374
- Name: Deploy_To_Production
378375
Actions:
379376
- Name: app-deploy

cicd/2-cicd/deploy-cicd.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ echo Deploying Javabuilder CICD Pipeline
77
# - TARGET_BRANCH: Defaults to `main`, passed as a Parameter for "cicd/2-cicd/cicd.template.yml"
88
# - MODE: Can be 'standard' (default) or 'adhoc', passed as a Parameter for "cicd/2-cicd/cicd.template.yml"
99
# - GITHUB_BADGE_ENABLED: defaults to true, passed as a Parameter for "cicd/2-cicd/cicd.template.yml"
10-
# - STACK_NAME: defaults to an automated naming convention, no current use cases for changing this.
1110

1211
# 'Developer' role requires a specific service role for all CloudFormation operations.
1312
if [[ $(aws sts get-caller-identity --query Arn --output text) =~ "assumed-role/Developer/" ]]; then
@@ -20,9 +19,9 @@ fi
2019
TARGET_BRANCH=${TARGET_BRANCH-'main'}
2120
if [ "$TARGET_BRANCH" == "main" ]
2221
then
23-
STACK_NAME=${STACK_NAME-'javabuilder-cicd'}
22+
STACK_NAME="javabuilder-cicd"
2423
else
25-
STACK_NAME=${STACK_NAME-"javabuilder-$TARGET_BRANCH-cicd"}
24+
STACK_NAME=${"javabuilder-$TARGET_BRANCH-cicd"}
2625
fi
2726

2827
MODE=${MODE-'standard'}

0 commit comments

Comments
 (0)