forked from k8sgateway/k8sgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (80 loc) · 4.66 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
# Note to developers/testers
# >> to run host the docs locally, do the following
# ensure you have hugo installed e.g. go install github.com/gohugoio/hugo@v0.81.0
# cd to the docs dir
# make serve-site -B
VERSION ?= 1.0.1-dev # a basic version that can be overidden
HUGO_VERSION := 0.81.0
SOLO_HUGO_THEME_REVISION := v0.0.29
# The minimum version to maintain in our public docs
MIN_SCANNED_VERSION ?= v1.13.0
#----------------------------------------------------------------------------------
# Docs
#----------------------------------------------------------------------------------
.PHONY: site-common
site-common: clean gloo-enterprise-version
if [ ! -d themes/hugo-theme-soloio ]; then git clone https://github.com/solo-io/hugo-theme-soloio themes/hugo-theme-soloio; fi
git -C themes/hugo-theme-soloio checkout $(SOLO_HUGO_THEME_REVISION)
GO111MODULE=on go run cmd/generate_docs.go gen-releases -r gloo > opensource.out
GO111MODULE=on go run cmd/generate_docs.go gen-releases -r glooe > enterprise.out
GO111MODULE=on go run cmd/generate_docs.go gen-changelog-md -r gloo > content/static/content/gloo-changelog.docgen
GO111MODULE=on go run cmd/generate_docs.go gen-changelog-md -r glooe > content/static/content/glooe-changelog.docgen
# generate split security scans for gloo versions which HAVE received new split-templating updates
MIN_SCANNED_VERSION=$(MIN_SCANNED_VERSION) GO111MODULE=on go run cmd/generate_docs.go gen-security-scan-md -r gloo > content/static/content/gloo-security-scan.docgen
MIN_SCANNED_VERSION=$(MIN_SCANNED_VERSION) GO111MODULE=on go run cmd/generate_docs.go gen-security-scan-md -r glooe > content/static/content/glooe-security-scan.docgen
cat content/static/content/gloo-security-scan.docgen
./split-file-by-delimiter.sh content/static/content/gloo-security-scan.docgen \\\*\\\*\\\*
./split-file-by-delimiter.sh content/static/content/glooe-security-scan.docgen \\\*\\\*\\\*
# get enterprise helm values based on contents of _output/gloo-enterprise-version
GO111MODULE=on go run cmd/generate_docs.go get-enterprise-helm-values > content/static/content/glooe-values.docgen
rm -f opensource.out enterprise.out
.PHONY: site-test
site-test: site-common
# ensure hugo version locally installed matches the version in cloudbuild CI
hugo version | grep -q $(HUGO_VERSION)
hugo --config docs.toml
# ensure that valid json is generated. Common cause: using yaml ">" multiline string symbols in Hugo's toml headers
cat site/index.json | jq "." > /dev/null
.PHONY: site-release
site-release: site-common
# ensure hugo version locally installed matches the version in cloudbuild CI
hugo version | grep -q $(HUGO_VERSION)
hugo --config docs.toml
# ensure that valid json is generated. Common cause: using yaml ">" multiline string symbols in Hugo's toml headers
# (if it passes here, it will pass on the subsequent generation so no need to check both hugo calls)
cat site/index.json | jq "." > /dev/null
mv site site-latest
hugo --config docs.toml
.PHONY: serve-site
serve-site: site-test
# ensure hugo version locally installed matches the version in cloudbuild CI
hugo version | grep -q $(HUGO_VERSION)
hugo --config docs.toml --themesDir themes server -D
.PHONY: clean
clean:
rm -fr ./site ./resources ./site-latest ./site-versioned ./public ./ci ./gloo-temp ./themes
# Uses https://github.com/gjtorikian/html-proofer
# Does not require running site; just make sure you generate the site and then run it
# Install with gem install html-proofer
# Another option we could use is wget: https://www.digitalocean.com/community/tutorials/how-to-find-broken-links-on-your-website-using-wget-on-debian-7
.PHONY: check-links
check-links:
htmlproofer ./site/ --empty-alt-ignore --allow-hash-href --alt-ignore "/img/Gloo-01.png" --url-ignore "/localhost/,/github.com/solo-io/solo-projects/,/developers.google.com/,/getgrav.org/,/github.com/solo-io/gloo/projects/,/developer.mozilla.org/"
# If on fedora, run
# sudo dnf -y install gcc ruby-devel rubygems zlib-devel
# to install html-proofer deps (only works with gcc, not clang!)
install-tools:
gem install html-proofer
.PHONY: build-site
build-site: clean
./build-docs.sh
# Generate _output/gloo-enterprise-version based on the latest patch enterprise version
# corresponding to content in changelog directory.
.PHONY: gloo-enterprise-version
gloo-enterprise-version:
cd .. && GO111MODULE=on go run hack/find_latest_enterprise_version/main.go
#----------------------------------------------------------------------------------
# Printing makefile variables utility
#----------------------------------------------------------------------------------
# use `make print-MAKEFILE_VAR` to print the value of MAKEFILE_VAR
print-% : ; @echo $($*)