From 4c1364ac8273a5c7b2930826daecfe02a85b1591 Mon Sep 17 00:00:00 2001 From: Florian Motlik Date: Thu, 14 Dec 2023 17:53:32 +0100 Subject: [PATCH] Add Build Status Command --- docs/_index.md | 1 + scripts/commands/codebuild/build-status.bash | 10 ++++++++++ scripts/commands/codebuild/build-status.md | 11 +++++++++++ scripts/commands/codebuild/build_selection.sh | 2 +- 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 scripts/commands/codebuild/build-status.bash create mode 100644 scripts/commands/codebuild/build-status.md diff --git a/docs/_index.md b/docs/_index.md index b4f92c6..9f5878a 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -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) diff --git a/scripts/commands/codebuild/build-status.bash b/scripts/commands/codebuild/build-status.bash new file mode 100644 index 0000000..0b925cb --- /dev/null +++ b/scripts/commands/codebuild/build-status.bash @@ -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}" \ No newline at end of file diff --git a/scripts/commands/codebuild/build-status.md b/scripts/commands/codebuild/build-status.md new file mode 100644 index 0000000..e450f09 --- /dev/null +++ b/scripts/commands/codebuild/build-status.md @@ -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 diff --git a/scripts/commands/codebuild/build_selection.sh b/scripts/commands/codebuild/build_selection.sh index c7cc68b..763922d 100644 --- a/scripts/commands/codebuild/build_selection.sh +++ b/scripts/commands/codebuild/build_selection.sh @@ -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" \ No newline at end of file +select_one_unsorted Build "$BUILD_IDS" \ No newline at end of file