[packaging] make docker aware of PKG_VERSION

When packaging, we can now pass a PKG_VERSION environment variable to
docker to force which version is being packaged.
If this variable is not passed to docker, then the version is the latest
git tag.

Change-Id: I8863d6a101e8d85573d8547bab1a667060648018
This commit is contained in:
Vincent Llorens 2016-12-06 15:41:26 +01:00
parent d82f0e3135
commit a1657004eb
3 changed files with 16 additions and 4 deletions

View File

@ -36,6 +36,10 @@ inside the synergy-service directory.
docker run -i -v /path/to/synergy-service:/tmp/synergy-service \ docker run -i -v /path/to/synergy-service:/tmp/synergy-service \
synergy-centos7-builder synergy-centos7-builder
You can override the package version that will be set during the packaging
process by adding `-e "PKG_VERSION=x.y.z"` to the above command line.
Otherwise, the package version will be set to the latest git tag.
This actually mount the synergy-service directory to `/tmp/synergy-service` on This actually mount the synergy-service directory to `/tmp/synergy-service` on
the guest. the guest.
@ -58,6 +62,10 @@ inside the synergy-service directory.
docker run -i -v /path/to/synergy-service:/tmp/synergy-service \ docker run -i -v /path/to/synergy-service:/tmp/synergy-service \
synergy-ubuntu14.04-builder synergy-ubuntu14.04-builder
You can override the package version that will be set during the packaging
process by adding `-e "PKG_VERSION=x.y.z"` to the above command line.
Otherwise, the package version will be set to the latest git tag.
- the resulting deb should be in the build directory if successful - the resulting deb should be in the build directory if successful

View File

@ -5,8 +5,10 @@ RPMBUILD=/home/pkger/rpmbuild
PKG_DIR=/tmp/synergy-service PKG_DIR=/tmp/synergy-service
function get_version() { function get_version() {
if [[ -z $PKG_VERSION ]]; then
cd $PKG_DIR cd $PKG_DIR
export PKG_VERSION=$(git tag -l "*.*.*" | sort -V | tail -1) export PKG_VERSION=$(git tag -l "*.*.*" | sort -V | tail -1)
fi
} }
function setup() { function setup() {

View File

@ -10,8 +10,10 @@ function copy_source() {
} }
function get_version() { function get_version() {
if [[ -z $PKG_VERSION ]]; then
cd $PKG_DIR cd $PKG_DIR
export PKG_VERSION=$(git tag -l "*.*.*" | sort -V | tail -1) export PKG_VERSION=$(git tag -l "*.*.*" | sort -V | tail -1)
fi
} }
function setup() { function setup() {