Code Pipeline

Code Pipeline

CodePipeline automates software release process. CodePipeline allows for modeling different stages of a release process. CodePipeline can be extended to adapt to the release.

Example CodePipeline

A CodePipeline consists of a source, either from an Amazon S3 bucket, AWS CodeCommit, or GitHub, and one or more build projects. In the following example a CodePipeline monitors a GitHub repository for changes. When changes are detected the pipeline will install the necessary dependencies and build the project.

BuildPipeline:
  Type: AWS::CodePipeline::Pipeline
  Properties:
    Name: BuildPipeline
    Stages:
      ...

GitHub Source Action

The first stage of the pipeline retrieves the source from GitHub. AWS requires that the GitHub access token has the proper permissions and is uploaded into the appropriate account.

Stages:
  - Name: Source
    RunOrder: 1
    OutputArtifacts:
      - GitHubSource
    ActionTypeId:
      Owner: ThirdParty
      Category: Source
      Provider: GitHub
     Configuration:
       Owner: GitHubAccountName
       Repo: GitHubRepositoryName
       Branch: GitHubBranchName
       PollForSourceChanges: 'false'
       OAuthToken: '{{resolve:secretsmanager:MyGitHubSecret:SecretString:token}}'

PollForSourceChanges must be false for a GitHub Source.

Configuring an access token is outside the scope of this paper. sample access tokens

Build Project

The pipeline's second stage is responsible for building the source action's output artifacts.

 

The environment:

 

build env reference docker in codebuild

Artifacts and Outputs:

artifact output

Permissions:

Deploy:

Other Considerations


See all posts