Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cicd): replace dash in env name for TestCommands build project #2439

Merged
merged 2 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestCC_Pipeline_Template(t *testing.T) {
Stages: []deploy.PipelineStage{
{
AssociatedEnvironment: &deploy.AssociatedEnvironment{
Name: "test",
Name: "staging-test",
Region: "us-west-2",
AccountID: "1111",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Resources:
Version: '2012-10-17'
Statement:
- Effect: Allow
Resource: 'arn:aws:iam::1111:role/phonetool-test-EnvManagerRole'
Resource: 'arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole'
Action:
- sts:AssumeRole
BuildProjectPolicy:
Expand Down Expand Up @@ -190,10 +190,10 @@ Resources:
Action:
- sts:AssumeRole
Resource:
- arn:aws:iam::1111:role/phonetool-test-EnvManagerRole
- arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole
Roles:
- !Ref PipelineRole
BuildTestCommandstest:
BuildTestCommandsstagingDASHtest:
Type: AWS::CodeBuild::Project
Properties:
EncryptionKey: !ImportValue phonetool-ArtifactKey
Expand Down Expand Up @@ -262,9 +262,9 @@ Resources:
- Name: SCCheckoutArtifact
OutputArtifacts:
- Name: BuildOutput
- Name: DeployTo-test
- Name: DeployTo-staging-test
Actions:
- Name: CreateOrUpdate-api-test
- Name: CreateOrUpdate-api-staging-test
Region: us-west-2
ActionTypeId:
Category: Deploy
Expand All @@ -273,31 +273,31 @@ Resources:
Provider: CloudFormation
Configuration:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-action-reference.html
ChangeSetName: phonetool-test-api
ChangeSetName: phonetool-staging-test-api
ActionMode: CREATE_UPDATE
StackName: phonetool-test-api
StackName: phonetool-staging-test-api
Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND
TemplatePath: BuildOutput::infrastructure/api-test.stack.yml
TemplateConfiguration: BuildOutput::infrastructure/api-test.params.json
TemplatePath: BuildOutput::infrastructure/api-staging-test.stack.yml
TemplateConfiguration: BuildOutput::infrastructure/api-staging-test.params.json
# The ARN of the IAM role (in the env account) that
# AWS CloudFormation assumes when it operates on resources
# in a stack in an environment account.
RoleArn: arn:aws:iam::1111:role/phonetool-test-CFNExecutionRole
RoleArn: arn:aws:iam::1111:role/phonetool-staging-test-CFNExecutionRole
InputArtifacts:
- Name: BuildOutput
RunOrder: 2
# The ARN of the environment manager IAM role (in the env
# account) that performs the declared action. This is assumed
# through the roleArn for the pipeline.
RoleArn: arn:aws:iam::1111:role/phonetool-test-EnvManagerRole
RoleArn: arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole
- Name: TestCommands
ActionTypeId:
Category: Test
Owner: AWS
Version: 1
Provider: CodeBuild
Configuration:
ProjectName: !Ref BuildTestCommandstest
ProjectName: !Ref BuildTestCommandsstagingDASHtest
RunOrder: 3
InputArtifacts:
- Name: SCCheckoutArtifact
4 changes: 2 additions & 2 deletions templates/cicd/pipeline_cfn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Resources:
- !Ref PipelineRole
{{- range $index, $stage := .Stages}}
{{- if $stage.TestCommands}}
BuildTestCommands{{$stage.Name}}:
BuildTestCommands{{logicalIDSafe $stage.Name}}:
Type: AWS::CodeBuild::Project
Properties:
EncryptionKey: !ImportValue {{$.AppName}}-ArtifactKey
Expand Down Expand Up @@ -396,7 +396,7 @@ Resources:
Version: 1
Provider: CodeBuild
Configuration:
ProjectName: !Ref BuildTestCommands{{$stage.Name}}
ProjectName: !Ref BuildTestCommands{{logicalIDSafe $stage.Name}}
RunOrder: 3
InputArtifacts:
- Name: SCCheckoutArtifact{{end}}{{end}}{{end}}{{end}}
Expand Down