codepipeline stage status

Taegu KangTaegu Kang
1 min read
  • outline

Script that checks status of Codepipeline stage.

  • script
#!/bin/bash
echo "CodePipeline Deploy Status"
for i in {0..2};
do
        for codepipeline in $(aws codepipeline list-pipelines --query pipelines[].name --output text)
        do
        stage=$(aws codepipeline get-pipeline-state --name $codepipeline --query 'stageStates[].latestExecution[].status | '[$i]'' --output text)
        if [[ $stage == "Succeeded" ]] || [[ $stage == "None" ]]
                then true
        else
                echo check $codepipeline
        fi
        done
done
echo "======================================================================================================================="

** Codepipeline stage : source -> build -> deploy

** None : No stage (ex. SPA or S3 without deployment)

0
Subscribe to my newsletter

Read articles from Taegu Kang directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Taegu Kang
Taegu Kang