Debian Codegraph @

ansible_collections/cisco/meraki/Makefile

raw
1 NAMESPACE := $(shell python -c 'import yaml; print(yaml.safe_load(open("galaxy.yml"))["namespace"])')
2 NAME := $(shell python -c 'import yaml; print(yaml.safe_load(open("galaxy.yml"))["name"])')
3 VERSION := $(shell python -c 'import yaml; print(yaml.safe_load(open("galaxy.yml"))["version"])')
4 MANIFEST := build/collections/ansible_collections/$(NAMESPACE)/$(NAME)/MANIFEST.json
5
6 PLUGIN_TYPES := $(filter-out __%,$(notdir $(wildcard plugins/*)))
7 METADATA := galaxy.yml LICENSE README.md meta/runtime.yml requirements.txt changelogs/changelog.yaml
8 $(foreach PLUGIN_TYPE,$(PLUGIN_TYPES),$(eval _$(PLUGIN_TYPE) := $(filter-out %__init__.py,$(wildcard plugins/$(PLUGIN_TYPE)/*.py))))
9 DEPENDENCIES := $(METADATA) $(foreach PLUGIN_TYPE,$(PLUGIN_TYPES),$(_$(PLUGIN_TYPE))) $(foreach ROLE,$(ROLES),$(wildcard $(ROLE)/*/*)) $(foreach ROLE,$(ROLES),$(ROLE)/README.md)
10
11 COLLECTION_COMMAND ?= ansible-galaxy
12 TEST =
13 FLAGS =
14
15
16 default: help
17 help:
18 @echo "Please use \`make <target>' where <target> is one of:"
19 @echo " help to show this message"
20 @echo " info to show infos about the collection"
21 @echo " sanity to run santy tests"
22 @echo " setup to set up test, lint"
23
24 setup: test-setup
25
26 test-setup: | tests/test_playbooks/vars/server.yml
27 pip install --upgrade 'pip<20'
28 pip install --upgrade -r requirements-dev.txt
29
30 tests/test_playbooks/vars/server.yml:
31 cp [email protected] $@
32 @echo "For recording, please adjust $@ to match your reference server."
33
34 $(MANIFEST):
35 ansible-galaxy collection build --force
36 ansible-galaxy collection install cisco-meraki-* --force
37
38 build/src/%: %
39 install -m 644 -DT $< $@
40
41 doc-setup:
42 pip install --upgrade -r docs/requirements.txt
43 doc: $(MANIFEST)
44 mkdir -p ./docs/plugins
45 antsibull-docs collection --use-current --squash-hierarchy --dest-dir ./docs/plugins $(NAMESPACE).$(NAME)
46 make -C docs html
47
48
49 FORCE:
50
51 .PHONY: help dist lint sanity test test-crud test-check-mode test-other livetest setup test-setup doc-setup doc publish FORCE