Skip to content

Commit 28a1737

Browse files
authored
fix(cicd): replace dash in env name for TestCommands build project (#2439)
Fixes #2437 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 7c3358c commit 28a1737

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

internal/pkg/deploy/cloudformation/stack/cc_pipeline_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestCC_Pipeline_Template(t *testing.T) {
3232
Stages: []deploy.PipelineStage{
3333
{
3434
AssociatedEnvironment: &deploy.AssociatedEnvironment{
35-
Name: "test",
35+
Name: "staging-test",
3636
Region: "us-west-2",
3737
AccountID: "1111",
3838
},

internal/pkg/deploy/cloudformation/stack/testdata/pipeline/cc_template.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Resources:
2525
Version: '2012-10-17'
2626
Statement:
2727
- Effect: Allow
28-
Resource: 'arn:aws:iam::1111:role/phonetool-test-EnvManagerRole'
28+
Resource: 'arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole'
2929
Action:
3030
- sts:AssumeRole
3131
BuildProjectPolicy:
@@ -190,10 +190,10 @@ Resources:
190190
Action:
191191
- sts:AssumeRole
192192
Resource:
193-
- arn:aws:iam::1111:role/phonetool-test-EnvManagerRole
193+
- arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole
194194
Roles:
195195
- !Ref PipelineRole
196-
BuildTestCommandstest:
196+
BuildTestCommandsstagingDASHtest:
197197
Type: AWS::CodeBuild::Project
198198
Properties:
199199
EncryptionKey: !ImportValue phonetool-ArtifactKey
@@ -262,9 +262,9 @@ Resources:
262262
- Name: SCCheckoutArtifact
263263
OutputArtifacts:
264264
- Name: BuildOutput
265-
- Name: DeployTo-test
265+
- Name: DeployTo-staging-test
266266
Actions:
267-
- Name: CreateOrUpdate-api-test
267+
- Name: CreateOrUpdate-api-staging-test
268268
Region: us-west-2
269269
ActionTypeId:
270270
Category: Deploy
@@ -273,31 +273,31 @@ Resources:
273273
Provider: CloudFormation
274274
Configuration:
275275
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-action-reference.html
276-
ChangeSetName: phonetool-test-api
276+
ChangeSetName: phonetool-staging-test-api
277277
ActionMode: CREATE_UPDATE
278-
StackName: phonetool-test-api
278+
StackName: phonetool-staging-test-api
279279
Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND
280-
TemplatePath: BuildOutput::infrastructure/api-test.stack.yml
281-
TemplateConfiguration: BuildOutput::infrastructure/api-test.params.json
280+
TemplatePath: BuildOutput::infrastructure/api-staging-test.stack.yml
281+
TemplateConfiguration: BuildOutput::infrastructure/api-staging-test.params.json
282282
# The ARN of the IAM role (in the env account) that
283283
# AWS CloudFormation assumes when it operates on resources
284284
# in a stack in an environment account.
285-
RoleArn: arn:aws:iam::1111:role/phonetool-test-CFNExecutionRole
285+
RoleArn: arn:aws:iam::1111:role/phonetool-staging-test-CFNExecutionRole
286286
InputArtifacts:
287287
- Name: BuildOutput
288288
RunOrder: 2
289289
# The ARN of the environment manager IAM role (in the env
290290
# account) that performs the declared action. This is assumed
291291
# through the roleArn for the pipeline.
292-
RoleArn: arn:aws:iam::1111:role/phonetool-test-EnvManagerRole
292+
RoleArn: arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole
293293
- Name: TestCommands
294294
ActionTypeId:
295295
Category: Test
296296
Owner: AWS
297297
Version: 1
298298
Provider: CodeBuild
299299
Configuration:
300-
ProjectName: !Ref BuildTestCommandstest
300+
ProjectName: !Ref BuildTestCommandsstagingDASHtest
301301
RunOrder: 3
302302
InputArtifacts:
303303
- Name: SCCheckoutArtifact

templates/cicd/pipeline_cfn.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Resources:
236236
- !Ref PipelineRole
237237
{{- range $index, $stage := .Stages}}
238238
{{- if $stage.TestCommands}}
239-
BuildTestCommands{{$stage.Name}}:
239+
BuildTestCommands{{logicalIDSafe $stage.Name}}:
240240
Type: AWS::CodeBuild::Project
241241
Properties:
242242
EncryptionKey: !ImportValue {{$.AppName}}-ArtifactKey
@@ -396,7 +396,7 @@ Resources:
396396
Version: 1
397397
Provider: CodeBuild
398398
Configuration:
399-
ProjectName: !Ref BuildTestCommands{{$stage.Name}}
399+
ProjectName: !Ref BuildTestCommands{{logicalIDSafe $stage.Name}}
400400
RunOrder: 3
401401
InputArtifacts:
402402
- Name: SCCheckoutArtifact{{end}}{{end}}{{end}}{{end}}

0 commit comments

Comments
 (0)