summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-10-16 16:38:02 +0000
committerGerrit Code Review <review@openstack.org>2015-10-16 16:38:02 +0000
commitfca2c7e32569545341897e77aa214f76c811d9eb (patch)
tree4ca5f34f39f4412fc9b8d86ae670b82bf12cb52e
parent2f10c6a06f3f60da632b78387d7933c1b72ab153 (diff)
parentc9e42d6aacd6ca1490f940cd5602d87be45bd61e (diff)
Merge "Script to easily build a package"
-rw-r--r--.gitignore1
-rwxr-xr-xbuild-fast3
-rw-r--r--version-properties.sh32
3 files changed, 36 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 59a8a93..f6d0d6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
1/target 1/target
2/version.properties
2/work 3/work
3/.config 4/.config
diff --git a/build-fast b/build-fast
new file mode 100755
index 0000000..240d68b
--- /dev/null
+++ b/build-fast
@@ -0,0 +1,3 @@
1#!/bin/bash -eux
2. version-properties.sh
3mvn -Dproject-version="$PROJECT_VER" -DskipTests=true clean package
diff --git a/version-properties.sh b/version-properties.sh
new file mode 100644
index 0000000..584b352
--- /dev/null
+++ b/version-properties.sh
@@ -0,0 +1,32 @@
1#!/bin/bash -ex
2#
3# This is a script that helps us version build artifacts. It retrieves
4# git info and generates version strings.
5#
6# Source:
7# http://git.openstack.org/cgit/openstack-infra/project-config/tree/jenkins/scripts/version-properties.sh
8#
9
10# get version info from scm
11SCM_TAG=$(git describe --abbrev=0 --tags) || true
12SCM_SHA=$(git rev-parse --short HEAD) || true
13
14# assumes format is like this '0.0.4-2-g135721c'
15COMMITS_SINCE_TAG=$(git describe | awk '{split($0,a,"-"); print a[2]}') || true
16
17# just use git sha if there is no tag yet.
18if [[ "${SCM_TAG}" == "" ]]; then
19 SCM_TAG=$SCM_SHA
20fi
21
22# General build version should be something like '0.0.4.3.d4ee90c'
23# Release build version should be something like '0.0.5'
24if [[ "${COMMITS_SINCE_TAG}" == "" ]]; then
25 PROJECT_VER=$SCM_TAG
26else
27 PROJECT_VER="$SCM_TAG.$COMMITS_SINCE_TAG.$SCM_SHA";
28fi
29
30echo "SCM_SHA=$SCM_SHA" >version.properties
31echo "PROJECT_VER=$PROJECT_VER" >>version.properties
32echo "COMMITS_SINCE_TAG=$COMMITS_SINCE_TAG" >>version.properties