Skip to content

Commit

Permalink
{Make,Vagrant}file: fix version override & file
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Staretu <[email protected]>
  • Loading branch information
unclejack committed Apr 13, 2017
1 parent 4fdee6e commit 6b397f5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ Thumbs.db
test/systemtests/cfg.json

.vagrant-state

netplugin-version
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NAME := netplugin
# We are using date based versioning, so for consistent version during a build
# we evaluate and set the value of version once in a file and use it in 'tar'
# and 'release' targets.
VERSION_FILE := /tmp/$(NAME)-version
VERSION_FILE := $(NAME)-version
VERSION := `cat $(VERSION_FILE)`
TAR_EXT := tar.bz2
TAR_FILENAME := $(NAME)-$(VERSION).$(TAR_EXT)
Expand Down Expand Up @@ -280,6 +280,7 @@ tar: clean-tar

clean-tar:
@rm -f $(TAR_LOC)/*.$(TAR_EXT)
@rm -f ${VERSION_FILE}

# GITHUB_USER and GITHUB_TOKEN are needed be set to run github-release
release: tar
Expand Down
9 changes: 3 additions & 6 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ docker_swarm = ENV["CONTIV_DOCKER_SWARM"] || "classic_mode"
gopath_folder="/opt/gopath"
http_proxy = ENV['HTTP_PROXY'] || ENV['http_proxy'] || ''
https_proxy = ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ''
build_version = ENV['BUILD_VERSION'] || ''

cluster_ip_nodes = ""

Expand All @@ -40,6 +41,7 @@ echo "export CLUSTER_NODE_IPS=$2" >> /etc/profile.d/envvar.sh
echo "export CONTIV_CLUSTER_STORE=$6" >> /etc/profile.d/envvar.sh
echo "export CONTIV_V2PLUGIN_NAME=$9" >> /etc/profile.d/envvar.sh
echo "export CONTIV_DOCKER_SWARM=${10}" >> /etc/profile.d/envvar.sh
echo "export BUILD_VERSION=${11}" >> /etc/profile.d/envvar.sh
source /etc/profile.d/envvar.sh
installed_go=$(go version | awk '{ print $3}')
Expand All @@ -54,11 +56,6 @@ else
curl -sSL https://storage.googleapis.com/golang/go#{go_version}.linux-amd64.tar.gz | sudo tar -xz -C /usr/local
fi
if [[ $# -gt 9 ]] && [[ $9 != "" ]]; then
shift; shift; shift; shift; shift; shift; shift; shift; shift
echo "export $@" >> /etc/profile.d/envvar.sh
fi
# Change ownership for gopath folder
chown -R vagrant #{gopath_folder}
Expand Down Expand Up @@ -345,7 +342,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
ENV['CONTIV_NODE_OS'] || "",
ENV['CONTIV_V2PLUGIN_NAME'] || "contiv/v2netplugin:0.1",
ENV['CONTIV_DOCKER_SWARM'] || "classic_mode",
*ENV['CONTIV_ENV'],
build_version,
]
end
node.vm.provision "shell", run: "always" do |s|
Expand Down

0 comments on commit 6b397f5

Please sign in to comment.