Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: codebuild ci workflow options #1225

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions .github/scripts/run-codebuild-batch-job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,52 @@ error_exit() {
exit 1
}

PROJECT_NAME=$1
PROJECT_NAME=gh-aws-sdk-kotlin-svc-check-batch
# get the source version to be built (defaults to main branch if not specified)
SOURCE_VERSION=${2:-main}
SDK_PR=$3
SMITHY_PR=$4
SOURCE_VERSION=main
SDK_PR=""
SMITHY_PR=""

while [[ $# -gt 0 ]]; do
case "$1" in
--project)
if [[ "$2" == --* ]]; then
shift 1
else
PROJECT_NAME="$2"
shift 2
fi
;;
--source)
if [[ "$2" == --* ]]; then
shift 1
else
SOURCE_VERSION="$2"
shift 2
fi
;;
--sdk-pr)
if [[ "$2" == --* ]]; then
shift 1
else
SDK_PR="$2"
shift 2
fi
;;
--smithy-pr)
if [[ "$2" == --* || -z "$2" ]]; then
shift 1
else
SMITHY_PR="$2"
shift 2
fi
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done

export SDK_PR
export SMITHY_PR
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/codebuild-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ jobs:
id: svc-check-batch
run: |
.github/scripts/run-codebuild-batch-job.sh \
gh-aws-sdk-kotlin-svc-check-batch \
${{ github.event.pull_request.head.sha }} ${{ inputs.aws-sdk-kotlin-pr }} ${{ inputs.smithy-kotlin-pr }}
--project gh-aws-sdk-kotlin-svc-check-batch \
--source ${{ github.event.pull_request.head.sha }} \
--sdk-pr ${{ inputs.aws-sdk-kotlin-pr }} \
--smithy-pr ${{ inputs.smithy-kotlin-pr }}
- name: Cancel build
if: ${{ cancelled() }}
env:
Expand Down
Loading