From 765f1bd8ef500c4440624ecb464c0fc128441d1b Mon Sep 17 00:00:00 2001 From: Adam Sandor Date: Wed, 3 Aug 2016 17:14:29 +0200 Subject: [PATCH] [Release 0.10.0] pre-tag commit --- build.gradle | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 5aa54449..0218e0e8 100644 --- a/build.gradle +++ b/build.gradle @@ -92,17 +92,19 @@ task checkDockerAuthentication << { } task setVersionInBashScript << { - // set explicit version in bash script - ant.replace(file: "bin/minimesos", token: "MINIMESOS_TAG=\"latest\"", value: "MINIMESOS_TAG=\"${project.version}\"") - // commit modified files - exec { - workingDir "${project.rootDir}" - commandLine "git", "commit", "-a", "-m", "[Release ${project.version}] pre-tag commit" - } - // push update to repository - exec { - workingDir "${project.rootDir}" - commandLine "git", "push" + if (new File(project.rootDir, "bin/minimesos").text.contains('MINIMESOS_TAG="latest"')) { + // set explicit version in bash script + ant.replace(file: "bin/minimesos", token: 'MINIMESOS_TAG="latest"', value: "MINIMESOS_TAG=\"${project.version}\"") + // commit modified files + exec { + workingDir "${project.rootDir}" + commandLine "git", "commit", "-a", "-m", "[Release ${project.version}] pre-tag commit" + } + // push update to repository + exec { + workingDir "${project.rootDir}" + commandLine "git", "push" + } } }