mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-19 17:17:04 -04:00
ci: move baseline version detection into separate job
Multiple CI jobs may utilize a baseline version, i.e. the version that the current code should be tested against when doing comparative testing. To avoid repeating the non-trivial detection of the baseline version, move it into a separate job which creates an environment file that subsequent jobs may require via `needs` option. It is then possible to use the variable(s) defined in the script section of the new job.
This commit is contained in:
parent
3f205f3218
commit
ef4e2d2964
1 changed files with 22 additions and 7 deletions
|
|
@ -340,6 +340,24 @@ stages:
|
|||
sudo sh -x bin/tests/system/ifconfig.sh up;
|
||||
fi
|
||||
|
||||
ci-variables:
|
||||
stage: precheck
|
||||
<<: *precheck_job
|
||||
script:
|
||||
- export BIND_BASELINE_BRANCH="$(sed -n -E "s|^m4_define\(\[bind_VERSION_MINOR\], ([0-9]+)\)dnl$|\1|p" configure.ac)"
|
||||
# When testing a .0 release, compare it against the previous development
|
||||
# release (e.g., 9.19.0 and 9.18.0 should both be compared against 9.17.22).
|
||||
- if [ "$(sed -n -E "s|^m4_define\(\[bind_VERSION_PATCH\], ([0-9]+)\)dnl$|\1|p" configure.ac)" = "0" ]; then export BIND_BASELINE_BRANCH=$((BIND_BASELINE_BRANCH - 1 - (BIND_BASELINE_BRANCH % 2))); fi
|
||||
- export BIND_BASELINE_VERSION="$(curl -s "https://gitlab.isc.org/api/v4/projects/1/repository/tags?search=^v9.${BIND_BASELINE_BRANCH}&order_by=version" | jq -r ".[0].name")"
|
||||
- echo "BIND_BASELINE_BRANCH=$BIND_BASELINE_BRANCH" >> ci_vars.env
|
||||
- echo "BIND_BASELINE_VERSION=$BIND_BASELINE_VERSION" >> ci_vars.env
|
||||
needs:
|
||||
- job: autoreconf
|
||||
artifacts: true
|
||||
artifacts:
|
||||
reports:
|
||||
dotenv: ci_vars.env
|
||||
|
||||
cross-version-config-tests:
|
||||
stage: system
|
||||
<<: *base_image
|
||||
|
|
@ -354,13 +372,8 @@ cross-version-config-tests:
|
|||
- *configure
|
||||
- *setup_interfaces
|
||||
- make -j${BUILD_PARALLEL_JOBS:-1}
|
||||
- export BIND_BRANCH="$(sed -n -E "s|^m4_define\(\[bind_VERSION_MINOR\], ([0-9]+)\)dnl$|\1|p" configure.ac)"
|
||||
# When testing a .0 release, compare it against the previous development
|
||||
# release (e.g., 9.19.0 and 9.18.0 should both be compared against 9.17.22).
|
||||
- if [ "$(sed -n -E "s|^m4_define\(\[bind_VERSION_PATCH\], ([0-9]+)\)dnl$|\1|p" configure.ac)" = "0" ]; then export BIND_BRANCH=$((BIND_BRANCH - 1 - (BIND_BRANCH % 2))); fi
|
||||
- BASELINE="$(curl -s "https://gitlab.isc.org/api/v4/projects/1/repository/tags?search=^v9.${BIND_BRANCH}&order_by=version" | jq -r ".[0].name")"
|
||||
- git clone --branch "${BASELINE}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git "bind-${BASELINE}"
|
||||
- cd "bind-${BASELINE}"
|
||||
- git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git "bind-${BIND_BASELINE_VERSION}"
|
||||
- cd "bind-${BIND_BASELINE_VERSION}"
|
||||
- autoreconf -fi
|
||||
- *configure
|
||||
- make -j${BUILD_PARALLEL_JOBS:-1}
|
||||
|
|
@ -375,6 +388,8 @@ cross-version-config-tests:
|
|||
needs:
|
||||
- job: autoreconf
|
||||
artifacts: true
|
||||
- job: ci-variables
|
||||
artifacts: true
|
||||
artifacts:
|
||||
reports:
|
||||
junit: junit.xml
|
||||
|
|
|
|||
Loading…
Reference in a new issue