Skip to content

Commit 21175e9

Browse files
lrstewartdougch
authored andcommitted
ci: make start_codebuild.sh work for forks (#5178)
1 parent 8da62d4 commit 21175e9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

codebuild/bin/start_codebuild.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,20 @@ BUILDS=(
3232
)
3333

3434
usage() {
35-
echo "start_codebuild.sh <source_version>"
35+
echo "start_codebuild.sh <source_version> <repo>"
3636
echo " example: start_codebuild.sh pr/1111"
37-
echo " example: start_codebuild.sh test_branch"
3837
echo " example: start_codebuild.sh 1234abcd"
38+
echo " example: start_codebuild.sh test_branch lrstewart/s2n"
3939
}
4040

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

4950
add_command() {
5051
NAME=$1
@@ -55,8 +56,9 @@ add_command() {
5556
if [ "$BATCH" = "no-batch" ]; then
5657
START_COMMAND="start-build"
5758
fi
58-
COMMANDS+=("aws --region $REGION codebuild $START_COMMAND --source-version $SOURCE_VERSION
59-
--project-name $NAME")
59+
COMMANDS+=("aws --region $REGION codebuild $START_COMMAND --project-name $NAME
60+
--source-location-override https://github.com/$REPO
61+
--source-version $SOURCE_VERSION")
6062
}
6163

6264
for args in "${BUILDS[@]}"; do

0 commit comments

Comments
 (0)