forked from ibm-mas/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (64 loc) · 2.23 KB
/
Copy pathMakefile
File metadata and controls
84 lines (64 loc) · 2.23 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
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
.DEFAULT_GOAL := all
# Set TEST=no to skip tests, e.g.: make python TEST=no
# Set CLEAN=no to skip clean, e.g.: make python CLEAN=no
TEST ?= yes
CLEAN ?= yes
# Clean everything
# -----------------------------------------------------------------------------
.PHONY: clean
clean: clean-python clean-tekton
# Build everything
# -----------------------------------------------------------------------------
.PHONY: all
all: python tekton
# Python Package
# -----------------------------------------------------------------------------
.PHONY: clean-python
clean-python:
ifeq ($(CLEAN),yes)
rm -rf dist
endif
.PHONY: python
python: clean-python pytest dist/mas_cli-100.0.0.tar.gz
.PHONY: pytest
pytest:
ifeq ($(TEST),yes)
.venv/bin/pytest python/tests
endif
dist/mas_cli-100.0.0.tar.gz:
.venv/bin/python -m build
# Python Package Documentation
# -----------------------------------------------------------------------------
.venv-docs:
# We need to install the python-devops and cli packages because we generate documentation from their code using mkdocs directives
uv venv .venv-docs
uv pip install --python .venv-docs/bin/python setuptools
uv pip install --python .venv-docs/bin/python -e ../python-devops -e .
# Install mkdocs and the various plugins that we use, including our custom plugins
uv pip install --python .venv-docs/bin/python -q mkdocs properdocs mkdocs-carbon mkdocs-glightbox mkdocs-redirects
uv pip install --python .venv-docs/bin/python -e ./mkdocs_plugins
.PHONY: mkdocs-serve
mkdocs-serve: .venv-docs
.venv-docs/bin/mkdocs serve --livereload --dev-addr localhost:9010
# Tekton Definitions
# -----------------------------------------------------------------------------
.PHONY: tekton
tekton: clean-tekton tekton/target pytest-tekton
.PHONY: clean-tekton
clean-tekton:
ifeq ($(CLEAN),yes)
rm -rf tekton/target
rm -f python/src/mas/cli/templates/ibm-mas-tekton.yaml
endif
tekton/target:
DEV_MODE=true build/bin/build-tekton.sh
.PHONY: pytest-tekton
pytest-tekton:
ifeq ($(TEST),yes)
.venv/bin/pytest tekton/test_schema.py -v
endif
# Development aid
# -----------------------------------------------------------------------------
.PHONY: run
run:
podman run --rm -it -e IBM_ENTITLEMENT_KEY --pull Always quay.io/ibmmas/cli:master bash