This repository was archived by the owner on Jun 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (43 loc) · 1.62 KB
/
Makefile
File metadata and controls
51 lines (43 loc) · 1.62 KB
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
.DEFAULT_GOAL := help
.PHONY: all
all:
.PHONY: build
build: ## Build for local environment
@go build
.PHONY: run
run: build ## Run example script
# stein loads the HCL files located on .policy directory by default
# in addition, .policy directory can be overridden by each directory of given arguments
#
# in this case,
# stein applies rules located in these default directory to _examples/manifests/microservices/*/*/*/*
# * _examples/.policy/
# * _examples/manifests/.policy/
# stein doesn't apply this rules to them
# * _examples/spinnaker/.policy/
#
# Regardless of the default directory placed under the given path,
# the following environment variables can be specified for the policy applied to all paths.
# this variables can take multiple values separated by a comma, also can take directories and files
#
# export STEIN_POLICY=root-policy/,another-policy/special.hcl
./stein apply \
_examples/manifests/microservices/*/*/*/* \
_examples/spinnaker/*/*/*
.PHONY: help
help: ## Show help message for Makefile target
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: docs-build
docs-build: ## Build documentations with mkdocs
@docker build -t mkdocs docs
.PHONY: docs-live
docs-live: build-docs ## Live viewing with mkdocs
@docker run --rm -it -p 3000:3000 -v ${PWD}:/docs mkdocs
.PHONY: docs-deploy
docs-deploy: docs-build ## Deploy generated documentations to gh-pages
@docker run --rm -it -v ${PWD}:/docs -v ~/.ssh:/root/.ssh mkdocs mkdocs gh-deploy
.PHONY: test
test: ## Run test
@go test -v -race ./...