From 1468a3f661732b763dc8654e717146aaa03edf96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Hrb=C3=A1=C4=8D?= <david@hrbac.cz>
Date: Thu, 16 Feb 2017 09:43:10 +0100
Subject: [PATCH] Disable CI external links check on hot_fix merge

---
 .gitlab-ci.yml | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 053f9d5d4..65fddf587 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -37,14 +37,23 @@ spell check:
 
 ext_links:
   stage: test
-  image: davidhrbac/docker-mdcheck:latest
+  amagg: davidhrbac/docker-mdcheck:latest
   allow_failure: true
   after_script:
   - rm *.json
   script:
   #- find docs.it4i/ -name '*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10
   #- find docs.it4i/ -name '*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10 --allow-dupe --allow-redirect
-  - find docs.it4i/ -name '*.md' ! -name 'modules-*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10 --allow-dupe --allow-redirect
+  - >
+    # get commit message
+    COMMIT_MESSAGE=$(git log -1 --pretty=%B | grep "Merge branch 'hot_fix' into 'master'" )
+    # see if commit message contains "[skip ci]" string
+    if [[ ${COMMIT_MESSAGE} == *hot_fix* ]]; then
+      echo "Skipping ci build"
+      exit 0
+    else
+      find docs.it4i/ -name '*.md' ! -name 'modules-*.md' -exec grep --color -l http {} + | xargs awesome_bot -t 10 --allow-dupe --allow-redirect
+    fi
   only:
   - master
 
-- 
GitLab