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

ci: make start_codebuild.sh work for forks #5178

Merged
merged 1 commit into from
Mar 12, 2025
Merged
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
12 changes: 7 additions & 5 deletions codebuild/bin/start_codebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,20 @@ BUILDS=(
)

usage() {
echo "start_codebuild.sh <source_version>"
echo "start_codebuild.sh <source_version> <repo>"
echo " example: start_codebuild.sh pr/1111"
echo " example: start_codebuild.sh test_branch"
echo " example: start_codebuild.sh 1234abcd"
echo " example: start_codebuild.sh test_branch lrstewart/s2n"
}

if [ "$#" -ne "1" ]; then
if [ "$#" -lt "1" ]; then
usage
# Return instead of exit so we can `source` this script
# in order to get access to BUILDS.
return 1
fi
SOURCE_VERSION=$1
REPO=${2:-aws/s2n-tls}

add_command() {
NAME=$1
Expand All @@ -55,8 +56,9 @@ add_command() {
if [ "$BATCH" = "no-batch" ]; then
START_COMMAND="start-build"
fi
COMMANDS+=("aws --region $REGION codebuild $START_COMMAND --source-version $SOURCE_VERSION
--project-name $NAME")
COMMANDS+=("aws --region $REGION codebuild $START_COMMAND --project-name $NAME
--source-location-override https://github.com/$REPO
--source-version $SOURCE_VERSION")
}

for args in "${BUILDS[@]}"; do
Expand Down
Loading