summaryrefslogtreecommitdiff
path: root/jenkinstool
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-09-09 11:52:31 +0100
committerLars Wirzenius <liw@liw.fi>2012-09-09 11:52:31 +0100
commitc50bc5d91f44b43a10c17c4e1e7f5fc410a12bc8 (patch)
treecf55e7fc9c84b80c96fe5ccace5c8dff07761582 /jenkinstool
parentb1ca3b12dee13c53992dfe52bef378f35f7d0da1 (diff)
downloadjenkinstool-c50bc5d91f44b43a10c17c4e1e7f5fc410a12bc8.tar.gz
Add support for release builds
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"