forked from docker/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (37 loc) · 1.22 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
ifneq (, $(BUILDX_BIN))
export BUILDX_CMD = $(BUILDX_BIN)
else ifneq (, $(shell docker buildx version))
export BUILDX_CMD = docker buildx
else ifneq (, $(shell which buildx))
export BUILDX_CMD = $(which buildx)
else
$(error "Buildx is required: https://github.com/docker/buildx#installing")
endif
BUILDX_REPO ?= https://github.com/docker/buildx.git
BUILDX_REF ?= master
# Generate YAML docs from remote bake definition
# Usage BUILDX_REF=v0.7.0 make buildx-yaml
buildx-yaml:
$(eval $@_TMP_OUT := $(shell mktemp -d -t docs-output.XXXXXXXXXX))
DOCS_FORMATS=yaml $(BUILDX_CMD) bake --set "*.output=$($@_TMP_OUT)" "$(BUILDX_REPO)#$(BUILDX_REF)" update-docs
rm -rf ./_data/buildx/*
cp -R "$($@_TMP_OUT)"/out/reference/*.yaml ./_data/buildx/
rm -rf $($@_TMP_OUT)/*
# Build website and output to _site folder
release:
rm -rf _site
$(BUILDX_CMD) bake release
# Vendor Gemfile.lock
vendor:
$(BUILDX_CMD) bake vendor
# Check for broken links
htmlproofer:
$(BUILDX_CMD) bake htmlproofer
# Lint tool for markdown files
mdl:
$(BUILDX_CMD) bake mdl
# Deploy website and run it through Docker compose
# Available in your browser at http://localhost:4000
deploy:
docker compose up --build
.PHONY: buildx-yaml release vendor htmlproofer mdl deploy