-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (37 loc) · 1.35 KB
/
Makefile
File metadata and controls
50 lines (37 loc) · 1.35 KB
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
include prelude.mk
this-module-dir-path := $(shell realpath -e .)
define ci-cd-for-each-module
for module_dir_path in $(shell find module -mindepth 1 -maxdepth 1 -type d); do echo Running \`make $1\` in $$module_dir_path; cd $(CURDIR)/$$module_dir_path; make -f ci-cd.mk $(1); echo ---; done
endef
ci-cd-build:
$(call ci-cd-for-each-module,$@)
.PHONY: ci-cd-build
ci-cd-test:
$(call ci-cd-for-each-module,$@)
.PHONY: ci-cd-test
ci-cd-deploy:
$(call ci-cd-for-each-module,$@)
.PHONY: ci-cd-deploy
ci-cd-cron-daily:
$(call ci-cd-for-each-module,$@)
.PHONY: ci-cd-cron-daily
###############################################################################
init-modules:
for module_dir_path in $(shell find module -mindepth 1 -maxdepth 1 -type d); do test -s $$module_dir_path/ci-cd.mk || cp -v rc/ci-cd.mk $$module_dir_path/ci-cd.mk; done
.PHONY: init-modules
#index:
# mkdir -p $(CURDIR)/index/toolchain
# for tool in make; do \
# ln -vsrfn $(CURDIR)/module/$$tool $(CURDIR)/index/toolchain/$$tool; \
# done
#.PHONY: index
#################################################################################
## Todo
image := localhost/morpho/ci-cd
run:
test -b /tmp/block-dev-test || sudo mknod -m 0777 /tmp/block-dev-test b 125 1
docker run --device /tmp/block-dev-test:/tmp/block-dev-test -it $(image)
.PHONY: run
build:
docker build -t $(image) .
.PHONY: build