Files
xen/automation/gitlab-ci/build-each-commit.sh
T
Wei Liu 1d1f161153 gitlab-ci: allow specifying base and tip in build test
We will soon provide this new capability to humans and automated
systems.

The default behaviour is retained: tip and base are passed by Gitlab
CI.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-05-15 11:01:06 +01:00

19 lines
498 B
Bash
Executable File

#!/bin/bash
# For a newly pushed branch the BEFORE_SHA will be all 0s
if [[ ${BASE} == 0000000000000000000000000000000000000000 ]]; then
echo "Newly pushed branch, skipped"
exit 0
fi
git merge-base --is-ancestor ${BASE} ${TIP}
if [[ $? -ne 0 ]]; then
echo "${TIP} is not a descendent of ${BASE}, skipped"
exit 0
fi
echo "Building ${BASE}..${TIP}"
NON_SYMBOLIC_REF=1 ./automation/scripts/build-test.sh ${BASE} ${TIP} \
bash -c "git clean -ffdx && ./automation/scripts/build"