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

build: add action for test commands to cfn template #1033

Merged
merged 9 commits into from Jun 20, 2020

Conversation

huanjani
Copy link
Contributor

These changes bring the test commands introduced in #1029 all the way through execution. If test commands are present in deploy.PipelineStage, CodeBuild actions are added to the specified deploy stage(s) of the CFN template and run accordingly. Addresses #783.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@huanjani huanjani requested a review from a team as a code owner June 18, 2020 20:55
@huanjani huanjani requested a review from kohidave June 18, 2020 20:55
@huanjani
Copy link
Contributor Author

relevant part of a generated CFN template:

 - Name: DeployTo-test
          Actions:
            - Name: TestCommands
              ActionTypeId:
                Category: Test
                Owner: AWS
                Version: 1
                Provider: CodeBuild
              InputArtifacts:
                - Name: SCCheckoutArtifact
              Configuration:
                ProjectName: !Ref BuildTestCommands0
              RunOrder: 1
            - Name: CreateOrUpdate-svc1-test
              Region: us-west-2
              ActionTypeId:
                Category: Deploy
                Owner: AWS
                Version: 1
                Provider: CloudFormation
              Configuration:
                # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-action-reference.html
                ChangeSetName: sample-test-svc1
                ActionMode: CREATE_UPDATE
                StackName: sample-test-svc1
                Capabilities: CAPABILITY_NAMED_IAM
                TemplatePath: BuildOutput::infrastructure/svc1.stack.yml
                TemplateConfiguration: BuildOutput::infrastructure/svc1-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::327148513104:role/sample-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::327148513104:role/sample-test-EnvManagerRole
        - Name: DeployTo-prod
          Actions:
            - Name: TestCommands
              ActionTypeId:
                Category: Test
                Owner: AWS
                Version: 1
                Provider: CodeBuild
              InputArtifacts:
                - Name: SCCheckoutArtifact
              Configuration:
                ProjectName: !Ref BuildTestCommands1
              RunOrder: 1

Copy link
Contributor

@bvtujo bvtujo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really cool! Just a few questions!

templates/cicd/pipeline.yml Show resolved Hide resolved
templates/cicd/pipeline_cfn.yml Outdated Show resolved Hide resolved
@huanjani huanjani marked this pull request as draft June 18, 2020 21:58
@huanjani huanjani marked this pull request as ready for review June 18, 2020 22:22
Copy link
Contributor

@iamhopaul123 iamhopaul123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! Just a few questions

templates/cicd/pipeline_cfn.yml Outdated Show resolved Hide resolved
templates/cicd/pipeline_cfn.yml Show resolved Hide resolved
templates/cicd/pipeline_cfn.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@efekarakus efekarakus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, this looks great!

templates/cicd/pipeline_cfn.yml Outdated Show resolved Hide resolved
templates/cicd/pipeline_cfn.yml Show resolved Hide resolved
templates/cicd/pipeline_cfn.yml Outdated Show resolved Hide resolved
templates/cicd/pipeline_cfn.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@efekarakus efekarakus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 woohoo

templates/cicd/pipeline_cfn.yml Outdated Show resolved Hide resolved
@huanjani huanjani merged commit c383f2a into aws:master Jun 20, 2020
Sprint 🏃‍♀️ automation moved this from In review to Pending release Jun 20, 2020
@huanjani huanjani deleted the testcommand-cfn branch June 20, 2020 00:09
mergify bot pushed a commit that referenced this pull request Jun 22, 2020
Added app name to the build project name so that pipelines within the same account don't end up with the same test command build project name.

Follow-up to #1033.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Sprint 🏃‍♀️
  
Pending release
Development

Successfully merging this pull request may close these issues.

None yet

4 participants