-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
86 lines (69 loc) · 2.62 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
VERSION = 0.8.10
K8SVERSION = 1.19.1
.PHONY: all
all: mokctl.deploy tags
.PHONY: docker-builds
docker-builds: docker-mokctl docker-mokbox docker-baseimage
.PHONY: docker-uploads
docker-uploads: docker-upload-mokctl docker-upload-mokbox docker-upload-baseimage
.PHONY: mokctl-docker-mokctl
docker-mokctl: all
docker build --build-arg K8SVERSION=${K8SVERSION} -f package/Dockerfile.mokctl \
-t local/mokctl package
docker tag local/mokctl myownkind/mokctl
docker tag myownkind/mokctl myownkind/mokctl:${VERSION}
.PHONY: mokctl-docker-mokbox
docker-mokbox: all
docker build --build-arg K8SVERSION=${K8SVERSION} -f package/Dockerfile.mokbox \
-t local/mokbox package
docker tag local/mokbox docker.io/myownkind/mokbox
docker tag docker.io/myownkind/mokbox:latest docker.io/myownkind/mokbox:${VERSION}
.PHONY: mokctl-docker-baseimage
docker-baseimage: all
bash mokctl.deploy build image --tailf
docker tag local/mok-centos-7-v${K8SVERSION} myownkind/mok-centos-7-v${K8SVERSION}
docker tag myownkind/mok-centos-7-v${K8SVERSION} myownkind/mok-centos-7-v${K8SVERSION}:${VERSION}
.PHONY:
docker-upload-mokctl: docker-mokctl
docker push myownkind/mokctl
docker push myownkind/mokctl:${VERSION}
.PHONY: docker-upload-mokbox
docker-upload-mokbox:
docker push myownkind/mokbox
docker push myownkind/mokbox:${VERSION}
.PHONY: docker-upload-baseimage
docker-upload-baseimage:
# mok-centos-7-v${K8SVERSION} - Build with 'mokctl build image' first!
docker push myownkind/mok-centos-7-v${K8SVERSION}
docker push myownkind/mok-centos-7-v${K8SVERSION}:${VERSION}
mokctl.deploy: src/*.sh src/lib/*.sh mok-centos-7
bash src/embed-dockerfile.sh
cd src && ( echo '#!/usr/bin/env bash'; cat \
main.sh lib/parser.sh globals.sh error.sh util.sh getcluster.sh \
exec.sh deletecluster.sh createcluster.sh versions.sh containerutils.sh \
buildimage.deploy lib/JSONPath.sh; \
printf 'if [ "$$0" = "$${BASH_SOURCE[0]}" ] || [ -z "$${BASH_SOURCE[0]}" ]; then\n MA_main "$$@"\nfi\n' \
) >../mokctl.deploy
chmod +x mokctl.deploy
cp mokctl.deploy package/
.PHONY: install
install: all
install mokctl.deploy /usr/local/bin/mokctl
.PHONY: uninstall
uninstall:
rm -f /usr/local/bin/mokctl /usr/local/bin/cmdline-player
.PHONY: clean
clean:
rm -f mokctl.deploy src/buildimage.deploy package/mokctl.deploy \
tests/hardcopy tests/screenlog.0 tags
.PHONY: test
test: clean mokctl.deploy
shellcheck mokctl.deploy
shfmt -s -i 2 -d src/*.sh
cd tests && ./usage-checks.sh && ./e2e-tests.sh
.PHONY: buildtest
buildtest: clean mokctl.deploy
./tests/build-tests.sh
tags: src/*.sh
ctags --language-force=sh src/*.sh src/lib/*.sh tests/unit-tests.sh
# vim:noet:ts=2:sw=2