CodePipeline
Last updated
Last updated
AWS CodePipeline is a continuous delivery service you can use to model, visualize, and automate the steps required to release your software. You can quickly model and configure the different stages of a software release process. CodePipeline automates the steps required to release your software changes continuously.
Pipeline as Code
Managed by AWS
Workflow modeling
AWS service integration
1. Continuous Delivery
a software development methodology where the release process is automated. Every software change is automatically built, tested, and deployed to production.
Before the final push to production, a person, an automated test, or a business rule decides when the final push should occur.
Although every successful software change can be immediately released to production with continuous delivery, not all changes need to be released right away.
2. Continuous Integration
a software development practice where members of a team use a version control system and frequently integrate their work to the same location, such as a main branch.
Each change is built and verified to detect integration errors as quickly as possible.
Continuous integration is focused on automatically building and testing code, as compared to continuous delivery, which automates the entire software release process up to production.
when developers commit changes to a source repository, CodePipeline automatically detects the changes. Those changes are built, and if any tests are configured, those tests are run.
After the tests are complete, the built code is deployed to staging servers for testing. From the staging server, CodePipeline runs more tests, such as integration or load tests.
Upon the successful completion of those tests, and after a manual approval action that was added to the pipeline is approved, CodePipeline deploys the tested and approved code to production instance
Modeling and configuring your automated release process is easier if you understand the concepts and terms used in AWS CodePipeline.
Pipelines
Stages
Actions
Pipeline executions
Stopped executions
Failed executions
Superseded executions
Stage executions
Action executions
Transitions
Artifacts
Source revisions
A pipeline is a workflow construct that describes how software changes go through a release process. Each pipeline is made up of a series of stages.
A stage is a logical unit you can use to isolate an environment and to limit the number of concurrent changes in that environment.
Each stage contains actions that are performed on the application artifacts.
Your source code is an example of an artifact.
A stage might be a build stage, where the source code is built and tests are run. It can also be a deployment stage, where code is deployed to runtime environments.
Each stage is made up of a series of serial or parallel actions.
An action is a set of operations performed on application code and configured so that the actions run in the pipeline at a specified point.
This can include things like a source action from a code change, an action for deploying the application to instances, and so on.
Valid CodePipeline action types are
source
build
test
deploy
approval
invoke
An execution is a set of changes released by a pipeline. Each pipeline execution is unique and has its own ID.
An execution corresponds to a set of changes, such as a merged commit or a manual release of the latest commit.
Two executions can release the same set of changes at different times.
While a pipeline can process multiple executions at the same time, a pipeline stage processes only one execution at a time. To do this, a stage is locked while it processes an execution.
Two pipeline executions can't occupy the same stage at the same time. The execution waiting to enter the occupied stage is referred to an inbound execution.
An inbound execution can still fail, be superseded, or be manually stopped. Pipeline executions traverse pipeline stages in order.
Valid statuses for pipelines are
InProgress
Stopping
Stopped
Succeeded
Superseded
Failed
The pipeline execution can be stopped manually so that the in-progress pipeline execution does not continue through the pipeline.
If stopped manually, a pipeline execution shows a Stopping status until it is completely stopped.
There are two ways to stop a pipeline execution:
Stop and wait
Stop and abandon
If an execution fails, it stops and does not completely traverse the pipeline. Its status is FAILED status and the stage is unlocked.
A more recent execution can catch up and enter the unlocked stage and lock it.
You can retry a failed execution unless the failed execution has been superseded or is not retryable.
An execution can be superseded by a more recent execution at a certain point, which is the point between stages.
If an execution is waiting to enter a locked stage, a more recent execution might catch up and supersede it.
The newer execution now waits for the stage to unlock, and the superseded execution stops with a SUPERSEDED status.
When a pipeline execution is superseded, the execution is stopped and does not completely traverse the pipeline.
A stage execution is the process of completing all of the actions within a stage.
Valid statuses for stages are
InProgress
Stopping
Stopped
Succeeded
Failed
An action execution is the process of completing a configured action that operates on designated artifacts. These can be input artifacts, output artifacts, or both.
Valid statuses for actions are
InProgress
Abandoned
Succeeded
Failed
Action types are preconfigured actions that are available for selection in CodePipeline.
The action type is defined by its owner, provider, version, and category.
The action type provides customized parameters that are used to complete the action tasks in a pipeline.
A transition is the point where a pipeline execution moves to the next stage in the pipeline.
You can disable a stage's inbound transition to prevent executions from entering that stage, and then you can enable the transition to allow executions to continue.
When more than one execution arrives at a disabled transition, only the latest execution continues to the next stage when the transition is enabled.
This means that newer executions continue to supersede waiting executions while the transition is disabled, and then after the transition is enabled, the execution that continues is the superseding execution.
Artifacts refers to the collection of data, such as application source code, built applications, dependencies, definitions files, templates, and so on, that is worked on by pipeline actions.
Artifacts are produced by some actions and consumed by others.
In a pipeline, artifacts can be the set of files worked on by an action (input artifacts) or the updated output of a completed action (output artifacts).
Actions pass output to another action for further processing using the pipeline artifact bucket
When you make a source code change, a new version is created.
A source revision is the version of a source change that triggers a pipeline execution.
An execution processes that source revision only.
For GitHub and CodeCommit repositories, this is the commit. For S3 buckets or actions, this is the object version.
AWS CodePipeline is integrated with a number of AWS services and partner products and services.
Source action integrations
Build action integrations
Test action integrations
Deploy action integrations
Approval action integration with Amazon Simple Notification Service
Invoke action integrations
Amazon ECR source actions
Amazon S3 source actions
Connections to Bitbucket Cloud, GitHub (version 2), GitHub Enterprise Server, and GitLab
CodeCommit source actions
GitHub (version 1) source actions
CodeBuild build actions
CloudBees build actions
Jenkins build actions
TeamCity build actions
CodeBuild test actions
AWS Device Farm test actions
Ghost Inspector test actions
Micro Focus StormRunner Load test actions
Amazon S3 deploy actions
AWS AppConfig deploy actions
AWS CloudFormation deploy actions
AWS CloudFormation StackSets deploy actions
Amazon ECS deploy actions
Elastic Beanstalk deploy actions
AWS OpsWorks deploy actions
Service Catalog deploy actions
Amazon Alexa deploy actions
CodeDeploy deploy actions
XebiaLabs deploy actions
Amazon SNS is a fast, flexible, fully managed push notification service that lets you send individual messages or to fan out messages to large numbers of recipients.
Amazon SNS makes it simple and cost effective to send push notifications to mobile device users, email recipients or even send messages to other distributed services.
When you create a manual approval request in CodePipeline, you can optionally publish to a topic in Amazon SNS so that all IAM users subscribed to it are notified that the approval action is ready to be reviewed.
Lambda invoke actions
Snyk invoke actions
Step Functions invoke actions
With AWS CodePipeline, there are no upfront fees or commitments.
You pay only for what you use. AWS CodePipeline costs $1.00 per active pipeline* per month. To encourage experimentation, pipelines are free for the first 30 days after creation.
An active pipeline is a pipeline that has existed for more than 30 days and has at least one code change that runs through it during the month.
There is no charge for pipelines that have no new code changes running through them during the month. An active pipeline is not prorated for partial months.
As part of the AWS Free Tier, AWS CodePipeline offers new and existing customers one free active pipeline each month.
Your free usage is calculated each month across all regions and automatically applied to your bill - free usage does not accumulate.
You may incur additional charges for storing and accessing your pipeline artifacts in Amazon S3 and for triggering actions from other AWS and third-party services that you connect to your pipeline.