diff options
| author | Gaëtan Gilbert | 2020-10-12 12:35:05 +0200 |
|---|---|---|
| committer | Gaëtan Gilbert | 2020-10-12 12:40:52 +0200 |
| commit | c4f5d75bfef926c186272e2be5bdd1968db3fe88 (patch) | |
| tree | fa8f101a44de7d5e1c1ca8c4cb854a65e2fc591a /dev/ci/ci-common.sh | |
| parent | 6a0aad2f334a050f097de80162b8bfb4738459aa (diff) | |
Automatically merge overlays with most recent upstream version
This avoids the need to rebase the overlay when nothing has changed.
Diffstat (limited to 'dev/ci/ci-common.sh')
| -rw-r--r-- | dev/ci/ci-common.sh | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/dev/ci/ci-common.sh b/dev/ci/ci-common.sh index 0b15c2483d..d6f68fb0e9 100644 --- a/dev/ci/ci-common.sh +++ b/dev/ci/ci-common.sh @@ -44,6 +44,18 @@ CI_BUILD_DIR="$PWD/_build_ci" ls -l "$CI_BUILD_DIR" || true +declare -A overlays + +overlay() +{ + local project=$1 + local ov_url=$2 + local ov_ref=$3 + + overlays[${project}_URL]=$ov_url + overlays[${project}_REF]=$ov_ref +} + set +x for overlay in "${ci_dir}"/user-overlays/*.sh; do # shellcheck source=/dev/null @@ -64,17 +76,27 @@ git_download() { local project=$1 local dest="$CI_BUILD_DIR/$project" + local giturl_var="${project}_CI_GITURL" local giturl="${!giturl_var}" local ref_var="${project}_CI_REF" local ref="${!ref_var}" + local ov_url=${overlays[${project}_URL]} + local ov_ref=${overlays[${project}_REF]} + if [ -d "$dest" ]; then echo "Warning: download and unpacking of $project skipped because $dest already exists." - elif [ "$FORCE_GIT" = "1" ] || [ "$CI" = "" ]; then + elif [[ $ov_url ]] || [ "$FORCE_GIT" = "1" ] || [ "$CI" = "" ]; then git clone "$giturl" "$dest" cd "$dest" git checkout "$ref" + git log -n 1 + if [[ $ov_url ]]; then + git -c pull.rebase=false pull --no-ff "$ov_url" "$ov_ref" + git log -n 1 HEAD^2 + git log -n 1 + fi else # When possible, we download tarballs to reduce bandwidth and latency local archiveurl_var="${project}_CI_ARCHIVEURL" local archiveurl="${!archiveurl_var}" |
