@@ -26,11 +26,19 @@ Parameters:
26
26
Type : String
27
27
Description : The Resource Id component of the CodeStar connection ARN for the code-dot-org GitHub repository
28
28
Default : 7df08bcf-9883-42e8-8f5e-d083419d4fe9
29
+ Mode :
30
+ Type : String
31
+ Description : Whether this should create a pipeline for an 'adhoc' deployment or 'standard' pipeline.
32
+ Default : standard
33
+ AllowedValues : [adhoc, standard]
29
34
30
35
Conditions :
31
- TargetsMainBranch : !Equals
32
- - !Ref GitHubBranch
33
- - main
36
+ TargetsMainBranch : !Equals [ !Ref GitHubBranch, main ]
37
+ 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 ]
41
+
34
42
35
43
Resources :
36
44
@@ -290,46 +298,82 @@ Resources:
290
298
OutputArtifacts :
291
299
- Name : appBuildResults
292
300
293
- - Name : Deploy_To_Test
294
- Actions :
295
- - Name : app-deploy
296
- ActionTypeId :
297
- Category : Deploy
298
- Owner : AWS
299
- Version : 1
300
- Provider : CloudFormation
301
- InputArtifacts :
302
- - Name : appBuildResults
303
- Configuration :
304
- StackName : !If [TargetsMainBranch, "javabuilder-test", !Sub "javabuilder-${GitHubBranch}-test"]
305
- ActionMode : CREATE_UPDATE
306
- TemplatePath : appBuildResults::packaged-app-template.yml
307
- TemplateConfiguration : appBuildResults::cicd/3-app/javabuilder/test.config.json
308
- ParameterName : { "SubDomainName": !If [TargetsMainBranch, "javabuilder-test", !Sub "javabuilder-${GitHubBranch}-test"] }
309
- Capabilities : CAPABILITY_AUTO_EXPAND
310
- RoleArn : !Sub arn:aws:iam::${AWS::AccountId}:role/admin/CloudFormationService
301
+ - !If
302
+ - DeployToAdhoc
303
+ - Name : Deploy_To_Adhoc
304
+ Actions :
305
+ - Name : app-deploy
306
+ ActionTypeId :
307
+ Category : Deploy
308
+ Owner : AWS
309
+ Version : 1
310
+ Provider : CloudFormation
311
+ InputArtifacts :
312
+ - Name : appBuildResults
313
+ Configuration :
314
+ StackName : !Sub "javabuilder-adhoc-${GitHubBranch}"
315
+ ActionMode : CREATE_UPDATE
316
+ TemplatePath : appBuildResults::packaged-app-template.yml
317
+ TemplateConfiguration : appBuildResults::cicd/3-app/javabuilder/adhoc.config.json
318
+ ParameterOverrides : !Join
319
+ - ' '
320
+ - - '{ "SubDomainName" : " '
321
+ - !Sub " javabuilder-adhoc-${GitHubBranch}"
322
+ - ' " }'
323
+ Capabilities : CAPABILITY_AUTO_EXPAND
324
+ RoleArn : !Sub arn:aws:iam::${AWS::AccountId}:role/admin/CloudFormationService
325
+ - !Ref AWS::NoValue
311
326
312
- - Name : Integration_Test
313
- Actions :
314
- - Name : integration-test
315
- ActionTypeId :
316
- Category : Build
317
- Owner : AWS
318
- Provider : CodeBuild
319
- Version : 1
320
- InputArtifacts :
321
- - Name : sourceCode
322
- Configuration :
323
- ProjectName : !Ref IntegrationTestBuildProject
324
- EnvironmentVariables : !Sub
325
- - ' [{"name":"APP_SUBDOMAIN","value":"${SUBDOMAIN}","type":"PLAINTEXT"},{"name":"APP_BASE_DOMAIN","value":"${BASE_DOMAIN}","type":"PLAINTEXT"}]'
326
- - BASE_DOMAIN : code.org
327
- SUBDOMAIN : !If [TargetsMainBranch, "javabuilder-test", !Sub "javabuilder-${GitHubBranch}-test"]
328
- OutputArtifacts :
329
- - Name : integrationTestResultsPOC
327
+ - !If
328
+ - DeployToTest
329
+ - Name : Deploy_To_Test
330
+ Actions :
331
+ - Name : app-deploy
332
+ ActionTypeId :
333
+ Category : Deploy
334
+ Owner : AWS
335
+ Version : 1
336
+ Provider : CloudFormation
337
+ InputArtifacts :
338
+ - Name : appBuildResults
339
+ Configuration :
340
+ StackName : !If [TargetsMainBranch, "javabuilder-test", !Sub "javabuilder-${GitHubBranch}-test"]
341
+ ActionMode : CREATE_UPDATE
342
+ TemplatePath : appBuildResults::packaged-app-template.yml
343
+ TemplateConfiguration : appBuildResults::cicd/3-app/javabuilder/test.config.json
344
+ ParameterOverrides : !Join
345
+ - ' '
346
+ - - '{ "SubDomainName" : " '
347
+ - !If [ TargetsMainBranch, 'javabuilder-test', !Sub 'javabuilder-${GitHubBranch}-test' ]
348
+ - '" }'
349
+ Capabilities : CAPABILITY_AUTO_EXPAND
350
+ RoleArn : !Sub arn:aws:iam::${AWS::AccountId}:role/admin/CloudFormationService
351
+ - !Ref AWS::NoValue
352
+
353
+ - !If
354
+ - DeployToTest
355
+ - Name : Integration_Test
356
+ Actions :
357
+ - Name : integration-test
358
+ ActionTypeId :
359
+ Category : Build
360
+ Owner : AWS
361
+ Provider : CodeBuild
362
+ Version : 1
363
+ InputArtifacts :
364
+ - Name : sourceCode
365
+ Configuration :
366
+ ProjectName : !Ref IntegrationTestBuildProject
367
+ EnvironmentVariables : !Sub
368
+ - ' [{"name":"APP_SUBDOMAIN","value":"${SUBDOMAIN}","type":"PLAINTEXT"},{"name":"APP_BASE_DOMAIN","value":"${BASE_DOMAIN}","type":"PLAINTEXT"}]'
369
+ - BASE_DOMAIN : code.org
370
+ SUBDOMAIN : !If [TargetsMainBranch, "javabuilder-test", !Sub "javabuilder-${GitHubBranch}-test"]
371
+ OutputArtifacts :
372
+ - Name : integrationTestResultsPOC
373
+ - !Ref AWS::NoValue
330
374
331
375
- !If
332
- - TargetsMainBranch
376
+ - DeployToProd
333
377
- Name : Deploy_To_Production
334
378
Actions :
335
379
- Name : app-deploy
@@ -340,12 +384,17 @@ Resources:
340
384
Provider : CloudFormation
341
385
InputArtifacts :
342
386
- Name : appBuildResults
387
+ # The value of `Configuration` must be an object with String (or simple type) properties
343
388
Configuration :
344
389
StackName : !If [TargetsMainBranch, "javabuilder", !Sub "javabuilder-${GitHubBranch}"]
345
390
ActionMode : CREATE_UPDATE
346
391
TemplatePath : appBuildResults::packaged-app-template.yml
347
392
TemplateConfiguration : appBuildResults::cicd/3-app/javabuilder/production.config.json
348
- ParameterName : { "SubDomainName": !If [TargetsMainBranch, "javabuilder", !Sub "javabuilder-${GitHubBranch}"] }
393
+ ParameterOverrides : !Join
394
+ - ' '
395
+ - - '{ "SubDomainName" : " '
396
+ - !If [ TargetsMainBranch, 'javabuilder', !Sub 'javabuilder-${GitHubBranch}' ]
397
+ - '" }'
349
398
Capabilities : CAPABILITY_AUTO_EXPAND
350
399
RoleArn : !Sub arn:aws:iam::${AWS::AccountId}:role/admin/CloudFormationService
351
400
- !Ref AWS::NoValue
0 commit comments