SUMMIT - Amazon Web Services Mark… · @ric__Harvey

Preview:

Citation preview

S U M M I TB e r l i n

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

CI/CD pipelines for ECS

S e s s i o n I D

Ric HarveyTechnical Developer EvangelistAmazon Web Services

rjh@amazon.com@ric__Harveyhttps://gitlab.com/ric_harvey/bl_docker_to_production_ecs

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Continuous integration processes

Builds, integration tests, UI testing, and more

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Continuous integration steps

1. Developers regularly check in code to a shared, central repository

2. Automated checks run regularly against the shared code base

3. Developers get feedback from the automated checks about their code

Developer

Shared codebaseAutomated checks

Check in code

Get feedback

Run checks

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

1. Developers regularly check in code to a shared, central repository

2. Automated checks run regularly against the shared code base

3. Developers get feedback from the automated checks about their code

Developer

Shared codebaseAutomated checks

Check in code

Get feedback

Run checks

Continuous integration steps

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

1. Developers regularly check in code to a shared, central repository

2. Automated checks run regularly against the shared code base

3. Developers get feedback from the automated checks about their code

Developer

Shared codebaseAutomated checks

Check in code

Get feedback

Run checks

Continuous integration steps

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

1. Developers regularly check in code to a shared, central repository

2. Automated checks run regularly against the shared code base

3. Developers get feedback from the automated checks about their code

Developer

Shared codebaseAutomated checks

Check in code

Get feedback

Run checks

Continuous integration steps

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

AWS CI/CD Tools

AWS CodeBuild + Third Party

AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS X-Ray

Source Build Test Deploy Monitor

AWS CodePipeline

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Continuous integration tools

Developer

Shared codebaseAutomated checks

Check in code

Get feedback

Run checks

Source Code• AWS CodeCommit• GitHub• GitHub Enterprise• Bitbucket• Amazon S3

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Continuous integration tools

Developer

Shared codebaseAutomated checks

Check in code

Get feedback

Run checks

Build & Test• AWS CodeBuild• Jenkins w/ CodeBuild

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Continuous integration tools

Developer

Shared codebaseAutomated checks

Check in code

Get feedback

Run checks

AWS Glue• Amazon CloudWatch Events• AWS Lambda

• Slack integration• SNS (Email / Texts)• Any AWS service

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

1.Automate the boring stuffLibrary upgrades or automatic tagging

2.Communicate statusEmail, Slack, build badges

3.Build fasterCaching, parallel builds

4.Check moreUnit and Integration tests

Continuous Integration

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

“Continuous Integration produces and validates artifacts, while Continuous Deployment deploys them.”

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

What is continuous delivery?

Source Build Pre-Test Deploy Post-

Test

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Basic continuous delivery best practices

• Versioned source• Automated build• Automated deployments• Deploy to > one instance• Unit tests• Integration tests• Continuous delivery• Operations dashboard

Source

Build

Deploy to integration stack

Integration tests

Deploy to production

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Use CodePipeline approvals to trigger tests

Source

MyAppSourceCodeCommit

Deploy

DeployToSegmentCodeDeploy

ValidateSegmentApproval

putApprovalResult

Approval message

DeployToSegmentCodeDeploy

SNS Topic

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T

Use SNS to start an automated approval check

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Ric HarveyTechnical Developer EvangelistAmazon Web Services

rjh@amazon.com@ric__Harveyhttps://gitlab.com/ric_harvey/bl_docker_to_production_ecs

Recommended