forked from open-edge-platform/geti
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.build
More file actions
145 lines (108 loc) · 4.23 KB
/
Makefile.build
File metadata and controls
145 lines (108 loc) · 4.23 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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Copyright (C) 2025 Intel Corporation
# LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE
PACKAGABLE_SUBPROJECTS := $(shell find . -name "Chart.yaml.template" | xargs dirname | xargs dirname)
.PHONY: clean
clean: clean-go clean-python clean-packagable
.PHONY: clean-go
clean-go:
@$(call run_for_each,$(GO_SUBPROJECTS),Cleaning for Go component,clean)
.PHONY: clean-python
clean-python:
@$(call run_for_each,$(PY_SUBPROJECTS),Cleaning for Python component,clean)
.PHONY: clean-packagable
clean-packagable:
@$(call run_for_each,$(PACKAGABLE_SUBPROJECTS),Cleaning for packagable components,clean)
.PHONY: build-image
build-image: build-image-go build-image-python
.PHONY: build-image-go
build-image-go:
@$(call run_for_each,$(GO_BUILDABLE_SUBPROJECTS),Building image for Go component,build-image)
.PHONY: build-image-python
build-image-python:
@$(call run_for_each,$(PY_BUILDABLE_SUBPROJECTS),Building image for Python component,build-image)
.PHONY: list-image
list-image: list-image-go list-image-python
.PHONY: list-image-go
list-image-go:
@$(call run_for_each,$(GO_BUILDABLE_SUBPROJECTS),Listing image for Python component,list-image)
.PHONY: list-image-python
list-image-python:
@$(call run_for_each,$(PY_BUILDABLE_SUBPROJECTS),Listing image for Go component,list-image)
.PHONY: publish-image
publish-image: publish-image-go publish-image-python
.PHONY: publish-image-go
publish-image-go:
@$(call run_for_each,$(GO_BUILDABLE_SUBPROJECTS),Pushing image for Go component,publish-image)
.PHONY: publish-image-python
publish-image-python:
@$(call run_for_each,$(PY_BUILDABLE_SUBPROJECTS),Pushing image for Python component,publish-image)
list-umbrella-chart:
@$(call run_for_each,$(PACKAGABLE_SUBPROJECTS),List components,list-umbrella-chart)
build-chart:
@$(call run_for_each,$(PACKAGABLE_SUBPROJECTS),Building charts for components,build-chart)
lint-chart:
@$(call run_for_each,$(PACKAGABLE_SUBPROJECTS),Building charts for components,lint-chart)
publish-chart:
@$(call run_for_each,$(PACKAGABLE_SUBPROJECTS),Building charts for components,publish-chart)
.PHONY: tests
tests: tests-go tests-python
.PHONY: tests-go
tests-go:
@$(call run_for_each,$(GO_SUBPROJECTS),Running tests for Go subproject,tests)
.PHONY: tests-python
tests-python:
@$(call run_for_each,$(PY_SUBPROJECTS),Running tests for Python subproject,tests)
.PHONY: test-unit
test-unit: test-unit-go test-unit-python
.PHONY: test-unit-go
test-unit-go:
@$(call run_for_each,$(GO_SUBPROJECTS),Running unit tests for Go subproject,test-unit)
.PHONY: test-unit-python
test-unit-python:
@$(call run_for_each,$(PY_SUBPROJECTS),Running unit tests for Python subproject,test-unit)
.PHONY: test-integration
test-integration: test-integration-go test-integration-python
.PHONY: test-integration-go
test-integration-go:
@$(call run_for_each,$(GO_SUBPROJECTS),Running integration tests for Go subproject,test-integration)
.PHONY: test-integration-python
test-integration-python:
@$(call run_for_each,$(PY_SUBPROJECTS),Running integration tests for Python subproject,test-integration)
.PHONY: test-component
test-component:
@$(call run_for_each,$(PY_SUBPROJECTS),Running component tests for Python subproject,test-component)
.PHONY: static-code-analysis
static-code-analysis: lint-go lint-python
.PHONY: lint-go
lint-go:
@$(call run_for_each,$(GO_SUBPROJECTS),Performing static code analysis for Go subproject,static-code-analysis)
.PHONY: lint-python
lint-python:
@$(call run_for_each,$(PY_SUBPROJECTS),Performing static code analysis for Python subproject,static-code-analysis)
.PHONY: list-subprojects
list-subprojects:
@echo "Available subprojects:"
@for svc in $(sort $(notdir $(SUBPROJECTS))); do \
echo " - $$svc"; \
done
.PHONY: list-services
list-services:
@echo "Available services:"
@for svc in $(sort $(notdir $(SERVICES))); do \
echo " - $$svc"; \
done
.PHONY: list-buildable-subprojects
list-buildable-subprojects:
@echo "Available buildable subprojects:"
@for svc in $(notdir $(BUILDABLE_SUBPROJECTS)); do \
echo " - $$svc"; \
done
define find_subprojects
$(shell find $(1) $(if $(3),-maxdepth $(3)) -path "*/.venv" -prune -o -name "$(2)" -exec dirname {} \;)
endef
define run_for_each
for item in $1; do \
echo "$2 in $$item"; \
(cd $$item && make $3); \
done
endef