From f3db5a05d18cceeacecda2b305b9afe29e49c62c Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Mon, 14 Jan 2019 19:25:28 +0000
Subject: [PATCH] CI: Change patch_version so it just checks version

---
 .ci/check_version.sh | 5 +++++
 .ci/patch_version.sh | 8 --------
 .gitlab-ci.yml       | 9 ++++-----
 3 files changed, 9 insertions(+), 13 deletions(-)
 create mode 100644 .ci/check_version.sh
 delete mode 100644 .ci/patch_version.sh

diff --git a/.ci/check_version.sh b/.ci/check_version.sh
new file mode 100644
index 000000000..257015736
--- /dev/null
+++ b/.ci/check_version.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+set -e
+
+cat fsl/version.py | egrep "^__version__ += +'$CI_COMMIT_REF_NAME' *$"
diff --git a/.ci/patch_version.sh b/.ci/patch_version.sh
deleted file mode 100644
index 482e4fc4a..000000000
--- a/.ci/patch_version.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-if [[ "x$CI_COMMIT_TAG" != "x" ]]; then
-  echo "Release detected - patching version - $CI_COMMIT_REF_NAME";
-  python -c "import fsl.version as v; v.patchVersion('fsl/version.py', '$CI_COMMIT_REF_NAME')";
-fi
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8c55f458..792aee38e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -123,16 +123,16 @@ variables:
 
 
 ###################################################
-# The patch_version anchor contains a before_script
+# The check_version anchor contains a before_script
 # section which is run on release builds, and makes
 # sure that the version in the code is up to date
 # (i.e. equal to the tag name).
 ###################################################
 
 
-.patch_version: &patch_version
+.check_version: &check_version
   before_script:
-    - bash ./.ci/patch_version.sh
+    - bash ./.ci/check_version.sh
 
 
 ############
@@ -191,7 +191,6 @@ style:
 
 build-doc:
   <<: *only_upstream
-  <<: *patch_version
 
   tags:
    - docker
@@ -215,7 +214,7 @@ build-doc:
 
 build-pypi-dist:
   <<: *only_releases
-  <<: *patch_version
+  <<: *check_version
 
   stage: build
   image: python:3.6
-- 
GitLab