Configure CodePipeline

Configure CodePipeline

To configure CodePipeline, follow these steps

  1. Access to CodePipeline interface

    • Select Pipeline
    • Select Create pipeline

ROSA

    • Choose pipeline settings
    • Name: RosaVotingAppPipeline
    • Leave the remaining options as default
    • Select Next

ROSA

    • Source:
    • Source provider: CodeCommit
    • Repository: rosa-voting-app
    • Branch: master
    • Leave the remaining options as default
    • Select Next

ROSA

    • Build:
    • Build provider: AWS CodeBuild
    • Region: Singapore
    • Project name: RosaVotingAppBuild
    • Leave the remaining options as default

ROSA

  1. Deploy:
    • Skip deploy stage deployed by us using OpenShift Cluster

ROSA

  1. Select Skip

ROSA

  1. Select Create pipeline

ROSA

  1. Create Pipeline successfully.

ROSA

Update service role for CodePipeline

  1. Assign the AWSCodeCommitPowerUser policy to the CodePipeline service role

ROSA

  1. Select Attach policies

ROSA

  1. Find and select AWSCodeCommitPowerUser

    • Select Attach policies

ROSA

  1. Complete policy assignment

ROSA

  1. To check if the pipeline is fired on code changes, let’s try editing the buildspec.yml file.
version: 0.2

phases:
  pre_build:
    commands:
        - echo Hello World
        - echo Testing codebuild flow
  post_build:
    commands:
        - echo Test successful!
        - echo Another pipeline has been triggered
  1. Update code to CodeCommit to trigger pipeline
git add buildspec.yml
git commit -m "test new pipeline"
git push
  1. You will see that the pipeline will be successfully initialized and running with the commands being run as the ones that have been updated in the buildspec file.

ROSA

  1. Complete Pipeline

ROSA

  1. View the pipeline running log.

ROSA