1
1
2
- .PHONY : all all-CI build clean default unit-test release tar checks go-version gofmt-src golint-src govet-src
2
+ .PHONY : all all-CI build clean default unit-test release tar checks go-version gofmt-src \
3
+ golint-src govet-src run-build compile-with-docker
3
4
4
5
DEFAULT_DOCKER_VERSION := 1.12.6
5
6
SHELL := /bin/bash
@@ -86,23 +87,26 @@ endif
86
87
87
88
checks : go-version gofmt-src golint-src govet-src misspell-src
88
89
89
- run-build : deps checks clean
90
+ compile :
90
91
cd $(GOPATH ) /src/github.com/contiv/netplugin && \
91
92
NIGHTLY_RELEASE=${NIGHTLY_RELEASE} BUILD_VERSION=${BUILD_VERSION} \
92
93
TO_BUILD=" ${TO_BUILD} " VERSION_FILE=${VERSION_FILE} \
93
94
scripts/build.sh
94
95
96
+ # fully prepares code for pushing to branch, includes building binaries
97
+ run-build : deps checks clean compile
98
+
99
+ compile-with-docker :
100
+ docker build \
101
+ --build-arg NIGHTLY_RELEASE=${NIGHTLY_RELEASE} \
102
+ --build-arg BUILD_VERSION=${BUILD_VERSION} \
103
+ -t netplugin:$$ {BUILD_VERSION:-devbuild}-$$(./scripts/getGitCommit.sh ) .
104
+
95
105
build-docker-image : start
96
106
vagrant ssh netplugin-node1 -c ' bash -lc "source /etc/profile.d/envvar.sh && cd /opt/gopath/src/github.com/contiv/netplugin && make host-build-docker-image"'
97
107
98
-
99
- ifdef NET_CONTAINER_BUILD
100
- install-shell-completion :
101
- cp scripts/contrib/completion/bash/netctl /etc/bash_completion.d/netctl
102
- else
103
108
install-shell-completion :
104
109
sudo cp scripts/contrib/completion/bash/netctl /etc/bash_completion.d/netctl
105
- endif
106
110
107
111
build : start ssh-build stop
108
112
@@ -116,12 +120,8 @@ update:
116
120
117
121
# setting CONTIV_NODES=<number> while calling 'make demo' can be used to bring
118
122
# up a cluster of <number> nodes. By default <number> = 1
119
- ifdef NET_CONTAINER_BUILD
120
- start :
121
- else
122
123
start :
123
124
CONTIV_DOCKER_VERSION=" $$ {CONTIV_DOCKER_VERSION:-$( DEFAULT_DOCKER_VERSION) }" CONTIV_NODE_OS=${CONTIV_NODE_OS} vagrant up
124
- endif
125
125
126
126
# ===================================================================
127
127
# kubernetes demo targets
@@ -195,26 +195,17 @@ mesos-cni-destroy:
195
195
demo-ubuntu :
196
196
CONTIV_NODE_OS=ubuntu make demo
197
197
198
- ifdef NET_CONTAINER_BUILD
199
- stop :
200
- else
201
198
stop :
202
199
CONTIV_NODES=$$ {CONTIV_NODES:-3} vagrant destroy -f
203
- endif
204
200
205
201
demo : ssh-build
206
202
vagrant ssh netplugin-node1 -c ' bash -lc "source /etc/profile.d/envvar.sh && cd /opt/gopath/src/github.com/contiv/netplugin && make host-restart host-swarm-restart"'
207
203
208
204
ssh :
209
205
@vagrant ssh netplugin-node1 -c ' bash -lc "cd /opt/gopath/src/github.com/contiv/netplugin/ && bash"' || echo ' Please run "make demo"'
210
206
211
- ifdef NET_CONTAINER_BUILD
212
- ssh-build :
213
- cd /go/src/github.com/contiv/netplugin && make run-build install-shell-completion
214
- else
215
207
ssh-build : start
216
208
vagrant ssh netplugin-node1 -c ' bash -lc "source /etc/profile.d/envvar.sh && cd /opt/gopath/src/github.com/contiv/netplugin && make run-build install-shell-completion"'
217
- endif
218
209
219
210
unit-test : stop clean
220
211
./scripts/unittests -vagrant
0 commit comments