simplify tar for vendor directory

Signed-off-by: Justin Cormack <justin@specialbusservice.com>
This commit is contained in:
Justin Cormack 2016-09-10 23:31:42 +01:00 committed by Justin Cormack
parent b605c70ce5
commit 5c634808df
6 changed files with 13 additions and 26 deletions

View File

@ -1,2 +1 @@
diagnostics-server usr/bin/diagnostics-server
files

View File

@ -1,15 +1,12 @@
all: usr/bin/diagnostics-server all: usr/bin/diagnostics-server
files: DEPS=Dockerfile $(wildcard *.go)
ls Dockerfile *.go > files
printf -- '-C\n..\n' >> files
(cd .. && find vendor) >> files
usr/bin/diagnostics-server: Dockerfile $(wildcard *.go) ../vendor/manifest files usr/bin/diagnostics-server: $(DEPS) ../vendor/manifest
tar cf - -T files | docker build -t diagnostics-server:build - tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t diagnostics-server:build -
docker run --rm --net=none diagnostics-server:build | tar xf - -C usr/bin docker run --rm --net=none diagnostics-server:build | tar xf - -C usr/bin
clean: clean:
rm -f usr/bin/diagnostics-server files rm -f usr/bin/diagnostics-server
.DELETE_ON_ERROR: .DELETE_ON_ERROR:

View File

@ -1,4 +1,3 @@
proxy proxy
files
usr/ usr/
sbin/ sbin/

View File

@ -1,13 +1,9 @@
all: usr/bin/slirp-proxy sbin/proxy-vsockd all: usr/bin/slirp-proxy sbin/proxy-vsockd
files: DEPS=Dockerfile $(wildcard *.go libproxy/*.go)
ls Dockerfile *.go > files
find libproxy >> files
printf -- '-C\n..\n' >> files
(cd .. && find vendor) >> files
proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../vendor/manifest files proxy: $(DEPS) ../vendor/manifest
tar cf - -T files | docker build -t proxy:build - tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t proxy:build -
docker run --rm --net=none proxy:build | tar xf - docker run --rm --net=none proxy:build | tar xf -
usr/bin/slirp-proxy: proxy usr/bin/slirp-proxy: proxy
@ -19,6 +15,6 @@ sbin/proxy-vsockd: proxy
cp proxy $@ cp proxy $@
clean: clean:
rm -rf proxy files sbin usr rm -rf proxy sbin usr
.DELETE_ON_ERROR: .DELETE_ON_ERROR:

View File

@ -1,2 +1 @@
files
sbin/ sbin/

View File

@ -1,16 +1,13 @@
all: vsudd all: vsudd
files: DEPS=Dockerfile $(wildcard *.go)
ls Dockerfile *.go > files
printf -- '-C\n..\n' >> files
(cd .. && find vendor) >> files
vsudd: Dockerfile $(wildcard *.go) ../vendor/manifest files vsudd: $(DEPS) ../vendor/manifest
mkdir -p sbin mkdir -p sbin
tar cf - -T files | docker build -t vsudd:build - tar cf - $(DEPS) -C .. $(shell cd .. && find vendor) | docker build -t vsudd:build -
docker run --rm --net=none vsudd:build | tar xf - -C sbin docker run --rm --net=none vsudd:build | tar xf - -C sbin
clean: clean:
rm -rf sbin files rm -rf sbin
.DELETE_ON_ERROR: .DELETE_ON_ERROR: