-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
99 lines (88 loc) · 2.51 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
.PHONY: check lint format up down
include .env
repl: up
@docker exec -it env /bin/zsh
up:
@docker compose up --detach
down:
@docker compose down --volumes
format:
@for script in $(SCRIPTS) ; do \
dos2unix $$script; \
done
@for file in $(FILES) ; do \
dos2unix $$file; \
done
lint:
@for image in $(IMAGES) ; do \
hadolint ./Dockerfile.$$image ; \
done
@hadolint ./Dockerfile
@yamllint .
@checkov
check:
@for script in $(SCRIPTS) ; do \
shfmt --write --list $$script; \
shellcheck $$script --enable all; \
done
.PHONY: build-image
build-image: format
@docker build --no-cache -t ${REGISTRY}/${GITHUB_ACTOR}/${TASK}:$(VERSION) -f ./Dockerfile.${TASK} .
@docker build --no-cache -t ${REGISTRY}/${GITHUB_ACTOR}/${TASK} -f ./Dockerfile.${TASK} .
.PHONY: gold gold-push
gold: format
@docker build --no-cache -t ${REGISTRY}/${GITHUB_ACTOR}/gold -f ./Dockerfile .
gold-push:
@docker push "${REGISTRY}/${GITHUB_ACTOR}/gold"
.PHONY: dev dev-push
dev:
@$(MAKE) TASK=$@ --no-print-directory build-image
dev-push:
@docker push "${REGISTRY}/${GITHUB_ACTOR}/dev:${VERSION}"
@docker push "${REGISTRY}/${GITHUB_ACTOR}/dev"
.PHONY: notebook notebook-push
notebook:
@$(MAKE) TASK=$@ --no-print-directory build-image
notebook-push:
@docker push "${REGISTRY}/${GITHUB_ACTOR}/notebook:${VERSION}"
@docker push "${REGISTRY}/${GITHUB_ACTOR}/notebook"
.PHONY: rust rust-push
rust:
@$(MAKE) TASK=$@ --no-print-directory build-image
rust-push:
@docker push "${REGISTRY}/${GITHUB_ACTOR}/rust:${VERSION}"
@docker push "${REGISTRY}/${GITHUB_ACTOR}/rust"
.PHONY: web web-push
web:
@$(MAKE) TASK=$@ --no-print-directory build-image
web-push:
@docker push "${REGISTRY}/${GITHUB_ACTOR}/web:${VERSION}"
@docker push "${REGISTRY}/${GITHUB_ACTOR}/web"
#
# Build variables
#
IMAGES = \
dev \
notebook \
rust \
web
SCRIPTS = \
./provision/dev/Brewfile \
./provision/dev/configure_locale.sh \
./provision/dev/configure_ohmyzsh.sh \
./provision/dev/install_dependencies.sh \
./provision/dev/manifest.nix \
./provision/gold/install_dependencies.sh \
./provision/gold/manifest.nix \
./provision/notebook/install_dependencies.sh \
./provision/rust/install_dependencies.sh \
./provision/web/manifest.nix \
./.github/actions/build-and-push-image/entrypoint.sh
FILES = \
./config/code-server/service/finish \
./config/code-server/service/run \
./config/jupyter/service/finish \
./config/jupyter/service/run \
./config/verdaccio/service/finish \
./config/verdaccio/service/log \
./config/verdaccio/service/run