[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH for-next 3/5] automation: add a script to build newly pushed commits in Gitlab CI



Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 automation/gitlab-ci/build-each-commit.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100755 automation/gitlab-ci/build-each-commit.sh

diff --git a/automation/gitlab-ci/build-each-commit.sh 
b/automation/gitlab-ci/build-each-commit.sh
new file mode 100755
index 0000000000..5b2e224710
--- /dev/null
+++ b/automation/gitlab-ci/build-each-commit.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# For a newly pushed branch the BEFORE_SHA will be all 0s
+if [[ ${CI_COMMIT_BEFORE_SHA} == 0000000000000000000000000000000000000000 ]]; 
then
+    echo "Newly pushed branch, skipped"
+    exit 0
+fi
+
+git merge-base --is-ancestor ${CI_COMMIT_BEFORE_SHA} ${CI_COMMIT_SHA}
+if [[ $? -ne 0 ]]; then
+    echo "${CI_COMMIT_SHA} is not a descendent of ${CI_COMMIT_BEFORE_SHA}, 
skipped"
+    exit 0
+fi
+
+NON_SYMBOLIC_REF=1 ./automation/scripts/build-test.sh ${CI_COMMIT_BEFORE_SHA} 
${CI_COMMIT_SHA} \
+               bash -c "make -j4 distclean && ./automation/scripts/build"
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.