forked from rancher/ecm-distro-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (54 loc) · 1.3 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
include cmd/Makefile
.PHONY: all
all: $(BINARIES)
.PHONY: gen_release_notes
gen_release_notes:
cd cmd/$@ && $(MAKE)
.PHONY: gen_release_report
gen_release_report:
cd cmd/$@ && $(MAKE)
.PHONY: rancher_release
rancher_release:
cd cmd/$@ && $(MAKE)
.PHONY: rke2_release
rke2_release:
cd cmd/$@ && $(MAKE)
.PHONY: release
release:
cd cmd/$@ && $(MAKE)
.PHONY: backport
backport:
cd cmd/$@ && $(MAKE)
.PHONY: test_coverage
test_coverage:
cd cmd/$@ && $(MAKE)
.PHONY: upstream_go_version
upstream_go_version:
cd cmd/$@ && $(MAKE)
.PHONY: semv
semv:
cd cmd/$@ && $(MAKE)
.PHONY: test
test:
go test -v -cover ./...
.PHONY: build-image
build-image:
docker build -t rancher/ecm-distro-tools:$(shell git rev-parse HEAD) .
.PHONY: package-binaries
package-binaries: $(BINARIES)
@$(eval export BIN_FILES = $(shell ls bin/))
for arch in $(ARCHS); do \
for os in $(OSs); do \
SUFFIX=$${os}-$${arch}; \
cd bin && \
tar cvf ../ecm-distro-tools.$${SUFFIX}.tar $(BIN_FILES) && \
cd ../; \
for binary in $(BINARIES); do \
cd cmd/$${binary}/bin && \
tar rvf ../../../ecm-distro-tools.$${SUFFIX}.tar $${binary}-$${SUFFIX} && \
cd ../../../; \
done; \
gzip < ecm-distro-tools.$${SUFFIX}.tar > ecm-distro-tools.$${SUFFIX}.tar.gz && \
rm -f ecm-distro-tools.$${SUFFIX}.tar; \
done; \
done