-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (51 loc) · 2.06 KB
/
Copy pathMakefile
File metadata and controls
68 lines (51 loc) · 2.06 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
VERSION := 2.2.2-preview
TARBALL := skupper-v2-$(VERSION).tar.gz
IMAGES = default ubuntu2404
PYTHON ?= `python -c 'import platform; print(".".join(platform.python_version_tuple()[0:2]))'`
PYTHON_DOCKER = 3.12
INTEGRATION_TARGETS = resource system
OPTIONS ?=
all: clean lint sanity unit coverage
lint:
pip install -r ./tests/unit/requirements.txt -U
ansible-galaxy collection install -r tests/integration/requirements.yml
ANSIBLE_ROLES_PATH=./tests/integration/targets ANSIBLE_LIBRARY=./plugins/modules ANSIBLE_MODULE_UTILS=./plugins/module_utils ansible-lint -v --offline
release-changelog:
pip install --user -U antsibull-changelog
antsibull-changelog release -v --reload-plugins
build-docs: build install
pip install --user -U virtualenv
rm -rf docs/* && mkdir docs/docsite
antsibull-docs sphinx-init --use-current --dest-dir ./docs/docsite skupper.v2
pip install -U -r docs/docsite/requirements.txt
./docs/docsite/build.sh
mv ./docs/docsite/build/html/* ./docs
touch ./docs/.nojekyll
rm -rf ./docs/docsite
build: clean
ansible-galaxy collection build
clean:
rm skupper-v2-*.tar.gz 2>/dev/null || true
rm -rf tests/output || true
install:
@[ -f "$(TARBALL)" ] && true || (echo "Collection has not been built" && false)
@ansible-galaxy collection install -f "$(TARBALL)"
publish: build
@[ -f "$(TARBALL)" ] && true || (echo "Collection has not been built" && false)
@ansible-galaxy collection publish "$(TARBALL)"
sanity:
ansible-test sanity --color --docker -v --python $(PYTHON) --requirements plugins/
.PHONY: unit
unit:
pip install -r ./tests/unit/requirements.txt -U
ansible-test units --color --coverage --venv --python $(PYTHON) -v
.PHONY: unit-docker
unit-docker: $(foreach img,$(IMAGES),unit-docker-$(img))
unit-docker-%: clean
ansible-test units --coverage --docker "$*" --python $(PYTHON_DOCKER) -v
integration:
ansible-test integration --allow-destructive --local -v $(OPTIONS)
integration-ssh:
ansible-test integration --allow-destructive --target "ssh:`id -un`@localhost,python=$(PYTHON)" -v $(OPTIONS)
coverage:
ansible-test coverage html || true