-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
66 lines (57 loc) · 1.8 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
.PHONY: build
build:
@ls -d */ | xargs -I{} /bin/bash -c "cd ./{} && make build || exit 255";
.PHONY: test
test:
@ls -d */ | xargs -I{} /bin/bash -c "cd ./{} && make test || exit 255";
.PHONY: push
push:
@ls -d */ | xargs -I{} /bin/bash -c "cd ./{} && make push || exit 255";
.PHONY: ci\:diff\:from
ci\:diff\:from:
@if [ "$(shell git rev-parse --abbrev-ref HEAD)" = "master" ]; then \
git --no-pager log --first-parent master --merges -n 2 --pretty=format:"%H" | tail -n 1; \
else \
echo "remotes/origin/master"; \
fi
.PHONY: ci\:diff\:to
ci\:diff\:to:
@echo "HEAD";
.PHONY: ci\:diff
ci\:diff:
@git --no-pager diff --diff-filter=ACMRTUXB --name-only "$(shell make ci:diff:from)" "$(shell make ci:diff:to)" \
| sed 's:^.*/compare/::g' \
| grep -v /goss/ \
| grep -v hooks/ \
| grep -v docker-compose.test.yml \
| grep -v Makefile \
| grep -v README.md \
| grep -v variant.lock \
| grep -v variant.mod \
| xargs -I{} dirname {} \
| xargs -I{} sh -c "test -d {} && echo {}" \
| sed 's/[.\/].*$$//' \
| sed '/^$$/d' \
| uniq;
.PHONY: ci\:changelog
ci\:changelog:
@if [ -n "${DIR}" ]; then \
git --no-pager log --no-merges --pretty=format:"- %s" "$(shell make ci:diff:from)...$(shell make ci:diff:to)" -- ${DIR}; \
else \
git --no-pager log --no-merges --pretty=format:"- %s" "$(shell make ci:diff:from)...$(shell make ci:diff:to)"; \
fi
.PHONY: ci\:notify
ci\:notify:
docker run -e CHATWORK_TOKEN=$${CHATWORK_API_TOKEN} \
-e ROOM_ID=$${CHATWORK_NOTIFICATION_ROOM_ID} \
chatwork/chatwork-notify "[info][title]$${TITLE}[/title]$${BODY}[hr]$${CIRCLE_BUILD_URL}[/info]"
.PHONY: arch
arch:
@uname -m
.PHONY: extension
extension:
@case $(shell make arch) in \
("arm64"|"aarch64") echo ".arm64"; ;; \
("x86_64") echo "" ;; \
(*) echo $(shell make arch) ;; \
esac