-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (52 loc) · 1.97 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
SHELL = /bin/bash
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
##@ General
# help target is based on https://github.com/operator-framework/operator-sdk/blob/master/release/Makefile.
.DEFAULT_GOAL := help
help: ## Show this help screen.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: help
.PHONY: lint-shell
##@ Building
build: ## Build Go binary.
cd cmd/render && CGO_ENABLED=0 go build
.PHONY: build
images: image ## Build images.
.PHONY: images
image-adoc-toolset: ## Build adoc-toolset image.
docker build \
-f build/images/Dockerfile.adoc-toolset \
-t localhost:5000/ods-pipeline/adoc-toolset \
.
.PHONY: image-adoc-toolset
tasks: ## Render tasks. Use VERSION=1.0.0 make tasks to render specific version.
go run github.com/opendevstack/ods-pipeline/cmd/taskmanifest \
-data ImageRepository=ghcr.io/opendevstack/ods-pipeline-adoc \
-data Version=$$(cat version) \
-template build/tasks/render.yaml \
-destination tasks/render.yaml
.PHONY: tasks
docs: tasks ## Render documentation for tasks.
go run github.com/opendevstack/ods-pipeline/cmd/taskdoc \
-task tasks/render.yaml \
-description build/docs/render.adoc \
-destination docs/render.adoc
.PHONY: docs
##@ Testing
test: test-cmd test-e2e ## Run complete testsuite.
.PHONY: test
test-cmd: ## Run testsuite of commands.
go test -v ./cmd/...
.PHONY: test-cmd
test-e2e: ## Run testsuite of end-to-end task runs.
go test -v -count=1 -timeout 10m ./test/e2e/...
.PHONY: test-e2e
##@ CI
check-docs: docs ## Check docs are up-to-date
@printf "Docs / tasks are " && git diff --quiet docs tasks && echo "up-to-date." || (echo "not up-to-date! Run 'make docs' to update."; false)
.PHONY: check-docs
ci: check-docs test ## Run CI tasks
.PHONY: ci