diff --git a/packaging/README.md b/packaging/README.md index 31f2305..28b89c4 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -15,3 +15,7 @@ Docker run -i -v /path/to/synergy-scheduler-manager:/tmp/python-synergy-scheduler-manager scheduler-builder-{centos7,ubuntu-14.04} ``` the deb/rpm will be output in `path/to/synergy-scheduler-manager/build` + + 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. diff --git a/packaging/docker/centos7/build.sh b/packaging/docker/centos7/build.sh index e64037e..e9b9f2d 100644 --- a/packaging/docker/centos7/build.sh +++ b/packaging/docker/centos7/build.sh @@ -6,8 +6,10 @@ PKG_DIR=/tmp/python-synergy-scheduler-manager function get_version() { - cd $PKG_DIR - export PKG_VERSION=$(git tag -l "*.*.*" | sort -V | tail -1) + if [[ -z $PKG_VERSION ]]; then + cd $PKG_DIR + export PKG_VERSION=$(git tag -l "*.*.*" | sort -V | tail -1) + fi } function setup() { diff --git a/packaging/docker/ubuntu-14.04/build.sh b/packaging/docker/ubuntu-14.04/build.sh index 5a3bcb5..209e4c3 100644 --- a/packaging/docker/ubuntu-14.04/build.sh +++ b/packaging/docker/ubuntu-14.04/build.sh @@ -11,8 +11,10 @@ function copy_source() { } function get_version() { - cd $PKG_DIR - export PKG_VERSION=$(git tag -l "*.*.*" | sort -V | tail -1) + if [[ -z $PKG_VERSION ]]; then + cd $PKG_DIR + export PKG_VERSION=$(git tag -l "*.*.*" | sort -V | tail -1) + fi } function setup() {