Skip to content

Commit 360fda1

Browse files
committed
allow passing user and branch to downstream
1 parent a4573f2 commit 360fda1

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

ci-support.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,8 @@ function install_ispc()
698698
function prepare_downstream_build()
699699
{
700700
local proj_name="$1"
701+
local user_name="$2"
702+
local branch_name="$3"
701703

702704
# This is here because PyOpenCL needs to record a config change so
703705
# CL headers are found. It git adds siteconf.py.
@@ -707,10 +709,17 @@ function prepare_downstream_build()
707709
git commit -a -m "Fake commit to record local changes"
708710
fi
709711

712+
url="https://github.com/$user_name/$proj_name.git"
710713
if [[ "$proj_name" = "mirgecom" ]]; then
711-
git clone "https://github.com/illinois-ceesd/$proj_name.git"
714+
default_url="https://github.com/illinois-ceesd/$proj_name.git"
712715
else
713-
git clone "https://github.com/inducer/$proj_name.git"
716+
default_url="https://github.com/inducer/$proj_name.git"
717+
fi
718+
719+
git clone "$url" --branch "$branch_name"
720+
if [[ $? -ne 0 ]]; then
721+
echo "*** Failed to clone '$url' branch '$branch_name'. Reverting to default."
722+
git clone "$default_url"
714723
fi
715724

716725
cd "$proj_name"
@@ -748,6 +757,8 @@ function prepare_downstream_build()
748757
function test_downstream()
749758
{
750759
local downstream_proj="$1"
760+
local downstream_user="${2:-inducer}"
761+
local downstream_branch="${3:-main}"
751762
local proj_name="$downstream_proj"
752763
local test_examples=0
753764

@@ -756,7 +767,7 @@ function test_downstream()
756767
test_examples=1
757768
fi
758769

759-
prepare_downstream_build "$proj_name"
770+
prepare_downstream_build "$proj_name" "$downstream_user" "$downstream_branch"
760771
build_py_project_in_conda_env
761772

762773
if [[ "$test_examples" == "0" ]]; then

0 commit comments

Comments
 (0)