]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
ci: check whether Deckard submodule commit is present on master
authorŠtěpán Balážik <stepan.balazik@nic.cz>
Thu, 13 Aug 2020 11:08:16 +0000 (13:08 +0200)
committerŠtěpán Balážik <stepan.balazik@nic.cz>
Thu, 13 Aug 2020 12:10:20 +0000 (14:10 +0200)
This is to prevent issues like https://gitlab.nic.cz/knot/knot-resolver/-/merge_requests/1036

.gitlab-ci.yml
ci/deckard_commit_check.sh [new file with mode: 0755]

index 02b14dc18b1ff55e1bbac1d214aa865f9abdc61f..1781825f25fcc7b45f4e22e1f26d95b8cd2e2b69 100644 (file)
@@ -168,6 +168,12 @@ build:darwin:
   script:
     - ci/travis.py ${CI_COMMIT_REF_NAME}
 
+deckard_commit:
+  <<: *test_nodep
+  script:
+    - ci/deckard_commit_check.sh
+  allow_failure: true
+  
 deckard:
   <<: *test_flaky
   tags:
diff --git a/ci/deckard_commit_check.sh b/ci/deckard_commit_check.sh
new file mode 100755 (executable)
index 0000000..5b4016d
--- /dev/null
@@ -0,0 +1,13 @@
+DECKARD_COMMIT=$(git ls-tree HEAD:tests/integration/ | grep commit | grep deckard | cut -f1 | cut -f3 '-d ')
+DECKARD_PATH="tests/integration/deckard"
+pushd $DECKARD_PATH > /dev/null
+if git merge-base --is-ancestor $DECKARD_COMMIT origin/master; then
+       echo "Deckard submodule commit is on in its master branch. All good in the hood."
+       exit 0
+else
+       echo "Deckard submodule commit $DECKARD_COMMIT is not in Deckard's master branch."
+       echo "This WILL cause CI breakages so make sure your changes in Deckard are merged"
+       echo "or point the submodule to another commit."
+       exit 1
+fi
+