diff --git a/Makefile b/Makefile index a5b74d4..4ea60d9 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,9 @@ endif BUILD_DATE=$(shell date +%Y%m%d) BUILD_REV=$(shell git rev-parse --short HEAD) +ifndef IMPOSM_BUILD_RELEASE BUILD_VERSION=dev-$(BUILD_DATE)-$(BUILD_REV) +endif VERSION_LDFLAGS=-X github.com/omniscale/imposm3.buildVersion=$(BUILD_VERSION) all: build test diff --git a/Vagrantfile b/Vagrantfile index 86f72cb..f37aa40 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -64,5 +64,8 @@ Vagrant.configure(2) do |config| # Enable provisioning with a shell script. Additional provisioners such as # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the # documentation for more information about their specific syntax and use. - config.vm.provision "shell", args: ENV['REVISION'], path: 'packaging.sh' + config.vm.provision "shell", env: { + :REVISION => ENV['REVISION'], + :IMPOSM_BUILD_RELEASE => ENV['IMPOSM_BUILD_RELEASE'] + }, path: 'packaging.sh' end diff --git a/packaging.sh b/packaging.sh index e675030..ad06483 100644 --- a/packaging.sh +++ b/packaging.sh @@ -43,7 +43,10 @@ EOF set -e # set -x -REVISION=${1:-master} +REVISION=${REVISION:-master} +if [[ -z "$IMPOSM_BUILD_RELEASE" ]]; then + unset IMPOSM_BUILD_RELEASE +fi BUILD_BASE=$HOME/imposm PREFIX=$BUILD_BASE/local