forked from metal3-io/metal3-io.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (30 loc) · 1.11 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
CONTAINER_RUNTIME ?= $(shell if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)
IMAGE_NAME ?= ruby
IMAGE_TAG ?= bullseye
HOST_PORT ?= 4000
.PHONY: serve
serve: # Serve the website on localhost:3000
$(CONTAINER_RUNTIME) run \
--rm -it --name metal3-io \
-w /srv/jekyll \
-v "$$(pwd):/srv/jekyll:Z" \
-p $(HOST_PORT):4000 \
$(IMAGE_NAME):$(IMAGE_TAG) \
sh -c "bundle install && bundle exec jekyll serve --future --watch --host 0.0.0.0 --port $(HOST_PORT)"
## ------------------------------------
## Linting and testing
## ------------------------------------
.PHONY: lint
lint: markdownlint spellcheck shellcheck pre-commit # Run all linting tools
.PHONY: markdownlint
markdownlint: # Run markdownlint
CONTAINER_RUNTIME=$(CONTAINER_RUNTIME) ./hack/markdownlint.sh
.PHONY: spellcheck
spellcheck: # Run spellcheck
CONTAINER_RUNTIME=$(CONTAINER_RUNTIME) ./hack/spellcheck.sh
.PHONY: shellcheck
shellcheck: # Run shellcheck
CONTAINER_RUNTIME=$(CONTAINER_RUNTIME) ./hack/shellcheck.sh
.PHONY: pre-commit
pre-commit: # Run pre-commit hooks
CONTAINER_RUNTIME=$(CONTAINER_RUNTIME) ./hack/pre-commit.sh