Skip to content

Commit

Permalink
Add Build Status Command
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Motlik committed Dec 14, 2023
1 parent fb5c1a9 commit 4c1364a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Following is a list of all available commands and links to their source document
* [`codebuild`](https://github.com/theserverlessway/awsinfo/blob/master/scripts/commands/codebuild/index.md)
* [`codebuild build`](https://github.com/theserverlessway/awsinfo/blob/master/scripts/commands/codebuild/build.md)
* [`codebuild build-reports`](https://github.com/theserverlessway/awsinfo/blob/master/scripts/commands/codebuild/build-reports.md)
* [`codebuild build-status`](https://github.com/theserverlessway/awsinfo/blob/master/scripts/commands/codebuild/build-status.md)
* [`codebuild builds`](https://github.com/theserverlessway/awsinfo/blob/master/scripts/commands/codebuild/builds.md)
* [`codebuild report`](https://github.com/theserverlessway/awsinfo/blob/master/scripts/commands/codebuild/report.md)
* [`codebuild report-groups`](https://github.com/theserverlessway/awsinfo/blob/master/scripts/commands/codebuild/report-groups.md)
Expand Down
10 changes: 10 additions & 0 deletions scripts/commands/codebuild/build-status.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source $CURRENT_COMMAND_DIR/build_selection.sh

awscli codebuild batch-get-builds --output table --ids $SELECTED --query "builds[].{
\"1.Id\":id,
\"2.Number\":buildNumber,
\"3.Phase\":currentPhase,
\"4.Status\":buildStatus,
\"5.StartedAt\":startTime,
\"6.FinishedAt\":endTime,
\"7.Environment\":environment}"
11 changes: 11 additions & 0 deletions scripts/commands/codebuild/build-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `awsinfo codebuild build-status [first-filters]+ -- [second-filters]*`

Show only the status and most relevant data of a build

## First Filter matches against

* Project Name

## Second Filter matches against

* Build Id
2 changes: 1 addition & 1 deletion scripts/commands/codebuild/build_selection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ select_one Project "$PROJECTS"

BUILD_IDS=$(awscli codebuild list-builds-for-project --project-name "$SELECTED" --max-items 100 --output text --query "ids[$(auto_filter_joined @ -- "$SECOND_RESOURCE")].[@]")

select_one Build "$BUILD_IDS"
select_one_unsorted Build "$BUILD_IDS"

0 comments on commit 4c1364a

Please sign in to comment.