forked from portworx/lcfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (51 loc) · 1.71 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Makefile for lcfs
# Maintainer Michael Vilain <[email protected]> [201701.16]
# assumes make is run as root or account running it is part of Docker group
.PHONY : gr-build gr-clean
GR_CONTAINER:=lcfs
ifdef VERSION
override BUILD_ARGS := $(BUILD_ARGS) --build-arg VERSION="$(VERSION)"
endif
ifdef REVISION
override BUILD_ARGS := $(BUILD_ARGS) --build-arg REVISION="$(REVISION)"
endif
ifdef BUILD_FLAGS
override BUILD_ARGS := $(BUILD_ARGS) --build-arg BUILD_FLAGS="$(BUILD_FLAGS)"
endif
TARGETS := gr-plugin
all: $(TARGETS)
build: gr-plugin
clean: gr-clean plugin-clean
rm -rf lcfs.bin lcfs_plugin.bin
-\rm -rf pkgs
-\rm -rf lcfs/version/* lcfs/rpm/lcfs lcfs/rpm/rpmtmp lcfs/rpm/tmp # Unable to \rm -rf. Docker bug so remove directories manually
run :
submodules:
git submodule init
git submodule update
# build lcfs plugin in a container (2017.05 only works with docker 1.13)
gr-plugin:
@echo "====================> building lcfs build container $(GR_CONTAINER)"
docker build -t $(GR_CONTAINER) $(BUILD_ARGS) -f Dockerfile.build .
docker run --name $(GR_CONTAINER) $(GR_CONTAINER) ls -l /tmp
docker cp $(GR_CONTAINER):/tmp/lcfs_plugin.bin .
docker cp $(GR_CONTAINER):/tmp/pkgs .
docker rm $(GR_CONTAINER)
gr-clean:
@echo "removing $(REPO)$(GR_CONTAINER)"
-docker rm -vf $(REPO)$(GR_CONTAINER)
-docker rmi $(GR_CONTAINER)
plugin:
@cd plugin && make
lcfs:
@echo "====================> building lcfs docker plugin..."
cd plugin/ && make lcfs #./build_plugin.sh
deploy:
@echo "====================> pushing lcfs to dockerhub..."
@cd plugin/ && make push_plugin #./push_plugin.sh
plugin-clean:
@cd plugin && make clean
vendor:
@cd plugin && make vendor
vendor-install:
@cd plugin && make vendor-install