-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
199 lines (153 loc) · 4.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
SHELL = /bin/sh
CI_IMAGE_NAME = airscript/ci:base
TESTS_IMAGE_NAME = airscript/tests:base
BLOG_IMAGE_NAME = airscript/blog:compose
DIND_IMAGE_NAME = docker:20.10.22-dind-alpine3.17
DEVCONTAINER_NAME = airscript-devcontainer-base
DEVCONTAINER_IMAGE_NAME = airscript/devcontainer:base
DEVCONTAINER_CLI_IMAGE_NAME = airscript/devcontainer:cli
.SUFFIXES:
.SUFFIXES: .sh
.PHONY: all
all: setup build run
.PHONY: setup
setup:
git config --local core.hooksPath .githooks/
.PHONY: clean
clean:
docker compose down
docker rmi $(BLOG_IMAGE_NAME)
cd ./themes/PaperMod && find . -name "*" -delete
cd ./tests/bats && find . -name "*" -delete
cd ./tests/libraries/bats-assert && find . -name "*" -delete
cd ./tests/libraries/bats-support && find . -name "*" -delete
.PHONY: hash
hash:
cat static/css/offline.css | openssl dgst -sha512 -binary | openssl base64 -A
cat static/js/notifications/dictionary.js | openssl dgst -sha512 -binary | openssl base64 -A
cat static/js/notifications/i18n.js | openssl dgst -sha512 -binary | openssl base64 -A
cat static/js/notifications/main.js | openssl dgst -sha512 -binary | openssl base64 -A
.PHONY: build
build: git-submodules
docker compose build
.PHONY: run
run:
docker compose up -d
.PHONY: all-tests
all-tests: build-tests run-tests
.PHONY: clean-tests
clean-tests:
docker rmi $(TESTS_IMAGE_NAME)
.PHONY: build-tests
build-tests:
mkdir -p tmp && \
cp -r .git .docker scripts tests Makefile tmp && \
docker build -f .docker/dockerfiles/tests.Dockerfile -t $(TESTS_IMAGE_NAME) .; \
rm -rf tmp
.PHONY: run-tests
run-tests:
docker run --rm $(TESTS_IMAGE_NAME) && \
docker rmi $(TESTS_IMAGE_NAME)
.PHONY: all-ci
all-ci: build-ci run-ci
.PHONY: clean-ci
clean-ci:
docker rmi $(CI_IMAGE_NAME)
.PHONY: build-ci
build-ci:
mkdir -p tmp && \
cp -r .circleci .docker scripts Makefile tmp && \
docker build -f .docker/dockerfiles/ci.Dockerfile -t $(CI_IMAGE_NAME) .; \
rm -rf tmp
.PHONY: run-ci
run-ci:
docker run --rm $(CI_IMAGE_NAME) && \
docker rmi $(CI_IMAGE_NAME)
.PHONY: all-devcontainer
all-devcontainer: build-devcontainer run-devcontainer
.PHONY: build-devcontainer
build-devcontainer:
mkdir -p tmp
cp -r .devcontainer .docker scripts Makefile tmp
docker build \
-f .docker/dockerfiles/devcontainer.Dockerfile \
-t $(DEVCONTAINER_IMAGE_NAME) .
rm -rf tmp
.PHONY: run-devcontainer
run-devcontainer:
docker run \
--rm \
--name $(DEVCONTAINER_NAME) \
--volume /var/run/docker.sock:/var/run/docker.sock \
$(DEVCONTAINER_IMAGE_NAME)
make clean-devcontainer
.PHONY: clean-devcontainer
clean-devcontainer:
docker rmi $(DIND_IMAGE_NAME) || true
docker rmi $(DEVCONTAINER_IMAGE_NAME)
docker rmi $(DEVCONTAINER_CLI_IMAGE_NAME)
.PHONY: teardown-devcontainer
teardown-devcontainer:
sh ./scripts/devcontainer/teardown.sh
.PHONY: install-bash
install-bash:
sh ./scripts/install/bash.sh
.PHONY: install-bats
install-bats:
sh ./scripts/install/bats.sh
.PHONY: install-npm
install-npm:
bash ./scripts/install/npm.sh
.PHONY: install-curl
install-curl:
bash ./scripts/install/curl.sh
.PHONY: install-hugo
install-hugo:
bash ./scripts/install/hugo.sh
.PHONY: install-git
install-git:
bash ./scripts/install/git.sh $(environment)
.PHONY: install-docker-cli
install-docker-cli:
bash ./scripts/install/docker-cli.sh
.PHONY: install-circleci-cli
install-circleci-cli:
bash ./scripts/install/circleci-cli.sh
.PHONY: install-netlify-cli
install-netlify-cli:
bash ./scripts/install/netlify-cli.sh
.PHONY: install-python3
install-python3:
bash ./scripts/install/python3.sh
.PHONY: install-gpp
install-gpp:
bash ./scripts/install/gpp.sh
.PHONY: install-devcontainer-cli
install-devcontainer-cli:
bash ./scripts/install/devcontainer-cli.sh
.PHONY: ci-verify
ci-verify:
bash ./scripts/ci/verify.sh $(environment)
.PHONY: ci-build
ci-build:
bash ./scripts/ci/build.sh
.PHONY: ci-deploy
ci-deploy:
bash ./scripts/ci/deploy.sh $(id) $(token)
.PHONY: ci-publish
ci-publish: docker-login docker-build docker-push
.PHONY: git-submodules
git-submodules:
bash ./scripts/shared/git-submodules.sh $(environment)
.PHONY: docker-login
docker-login:
bash ./scripts/docker/login.sh $(username) $(token)
.PHONY: docker-build
docker-build:
bash ./scripts/docker/build.sh $(tag)
.PHONY: docker-push
docker-push:
bash ./scripts/docker/push.sh $(tag)
.PHONY: tests-base
tests-base:
bash scripts/tests/base.sh