forked from netscaler/ansible-collection-netscaleradc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (75 loc) · 2.69 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
fmt:
autoflake plugins/modules/*.py
autoflake plugins/module_utils/*.py
autoflake tools/module_generator.py
autoflake --recursive tests/
black plugins/modules/*.py
black plugins/module_utils/*.py
black tools/module_generator.py
black tests/
isort plugins/modules/*.py
isort plugins/module_utils/*.py
isort tools/module_generator.py
isort tests/
yamlfmt .
fmt_tools:
# ignore if file not found
-autoflake tools/generated_modules/*.py
-autoflake tools/module_generator.py
-autoflake tools/nitro_resource_map.py
-black tools/generated_modules/*.py
-black tools/module_generator.py
-black tools/nitro_resource_map.py
-isort tools/generated_modules/*.py
-isort tools/module_generator.py
-isort tools/nitro_resource_map.py
generate_modules:
python3 tools/module_generator.py
install:
ansible-galaxy collection install . --force
line_length:
grep -l '.\{159,\}' -R plugins --include='*.py'
lint:
yamllint .
echo "\n\n\n\n\n\n\n\n\n\n"
ansible-lint
python3 -m pycodestyle --max-line-length 160 --config /dev/null --ignore E203,E402,E741,W503,W504 plugins tests
test_sanity: galaxy_importer install
cd ~/.ansible/collections/ansible_collections/netscaler/adc && \
ansible-test sanity --docker default
# ansible-test sanity --test shellcheck --docker default
test_int: install
cd ~/.ansible/collections/ansible_collections/netscaler/adc && \
ansible-test integration
# ansible-test integration nsip
build:
ansible-galaxy collection build --force
galaxy_importer: build
python3 -m galaxy_importer.main netscaler-adc-2.2.0.tar.gz
# build_docs:
# rm -rf _built_docs
# mkdir -p _built_docs
# make install
# antsibull-docs sphinx-init --use-current --dest-dir _built_docs netscaler.adc
# cd _built_docs
# pip3 install -r requirements.txt
# ./build.sh
# cd ..
# rsync -cprv _built_docs/build/html/ docs/ --delete-after # Do not use --delete-after as this will delete .nojekyll file
# git restore docs/.nojekyll
# Run examples/*.yaml playbooks individually
# ansible-playbook -i examples/inventory examples/playbook.yaml
# Run the playbook. if the return code is non-zero, save the output to a file
# skip the playbook which contains "password" in the file name
run_examples:
@for playbook in examples/*.yaml; do \
if [[ $$playbook == *"password"* || $$playbook == *"login"* || $$playbook == *"logout"* || $$playbook == *"route"* || $$playbook == locationfile.yaml || $$playbook == nsip6.yaml || $$playbook == hanode.yaml ]]; then \
continue; \
fi; \
echo "Running $$playbook"; \
ansible-playbook -i examples/inventory.ini $$playbook || \
ansible-playbook -i examples/inventory.ini $$playbook -vvv > $$playbook.out; \
done
action:
act -list
act --remote-name gh -j ansible-sanity-test