Skip to content

Commit

Permalink
allow passing user and branch to downstream
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Apr 28, 2022
1 parent a4573f2 commit 360fda1
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ci-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ function install_ispc()
function prepare_downstream_build()
{
local proj_name="$1"
local user_name="$2"
local branch_name="$3"

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

url="https://github.com/$user_name/$proj_name.git"
if [[ "$proj_name" = "mirgecom" ]]; then
git clone "https://github.com/illinois-ceesd/$proj_name.git"
default_url="https://github.com/illinois-ceesd/$proj_name.git"
else
git clone "https://github.com/inducer/$proj_name.git"
default_url="https://github.com/inducer/$proj_name.git"
fi

git clone "$url" --branch "$branch_name"
if [[ $? -ne 0 ]]; then
echo "*** Failed to clone '$url' branch '$branch_name'. Reverting to default."
git clone "$default_url"
fi

cd "$proj_name"
Expand Down Expand Up @@ -748,6 +757,8 @@ function prepare_downstream_build()
function test_downstream()
{
local downstream_proj="$1"
local downstream_user="${2:-inducer}"
local downstream_branch="${3:-main}"
local proj_name="$downstream_proj"
local test_examples=0

Expand All @@ -756,7 +767,7 @@ function test_downstream()
test_examples=1
fi

prepare_downstream_build "$proj_name"
prepare_downstream_build "$proj_name" "$downstream_user" "$downstream_branch"
build_py_project_in_conda_env

if [[ "$test_examples" == "0" ]]; then
Expand Down

0 comments on commit 360fda1

Please sign in to comment.