From 8d6acd19249b0e85b9fa288bd00e40c118eb9064 Mon Sep 17 00:00:00 2001
From: Benjamin Bertrand <benjamin.bertrand@esss.se>
Date: Fri, 29 Sep 2017 15:25:14 +0200
Subject: [PATCH] Force tags retrieval

Bug in bitbucket team project?
---
 Jenkinsfile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 98c2a9b..c7fc23f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,14 +1,11 @@
 pipeline {
     agent { label 'docker-compose' }
 
-    environment {
-        GIT_TAG = sh(returnStdout: true, script: 'git describe --exact-match || true').trim()
-    }
-
     stages {
         stage('Refresh') {
             steps {
                 slackSend (color: 'good', message: "STARTED: <${env.BUILD_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]>")
+                sh 'git fetch --tags'
                 sh 'make clean'
                 sh 'make refresh'
             }
@@ -29,6 +26,9 @@ pipeline {
             }
         }
         stage('Push') {
+            environment {
+                GIT_TAG = sh(returnStdout: true, script: 'git describe --exact-match || true').trim()
+            }
             when {
                 not { environment name: 'GIT_TAG', value: '' }
             }
-- 
GitLab