summaryrefslogtreecommitdiff
path: root/jenkinstool
diff options
context:
space:
mode:
Diffstat (limited to 'jenkinstool')
-rwxr-xr-xjenkinstool37
1 files changed, 36 insertions, 1 deletions
diff --git a/jenkinstool b/jenkinstool
index 4d73d06..e34e0f7 100755
--- a/jenkinstool
+++ b/jenkinstool
@@ -76,6 +76,36 @@ commit_date()
date -u --date="$commit_timestamp" +%%Y%%m%%dT%%H%%M%%S
}
+is_release()
+{
+ local project="$1"
+ local version="$2"
+
+ if [ -d .bzr ]
+ then
+ if bzr log -l1 | grep -Fx "tags: ${project}-${version}"
+ then
+ return 0
+ else
+ return 1
+ fi
+ elif [ -d .git ]
+ then
+ tag=$(git show-ref --tags "${project}-${version}" |
+ awk '{ print $1 }')
+ commit=$(git log -1 | awk '/^commit / { print $2 }')
+ if [ -n "$tag" ] && [ "$tag" = "$commit" ]
+ then
+ return 0
+ else
+ return 1
+ fi
+ else
+ echo "Unknown version control system" 1>&2
+ exit 1
+ fi
+}
+
project="%(project.name)s"
artifacts="%(global.artifacts)s/${project}"
project_artifacts="$artifacts/$project"
@@ -93,7 +123,12 @@ then
# Split into two so that if getting the upstream version fails, the
# script fails.
version="$(upstream_version)"
- version="$version.vcs$(commit_date)"
+ if is_release "$project" "$version"
+ then
+ echo "It is a release build -- not appending .vcsFOO"
+ else
+ version="$version.vcs$(commit_date)"
+ fi
debianversion="${version}-1.%(host.debian-dist)s"
debianurl="%(global.artifacts-url)s/debian"