-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 1.21 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
# pxeboot Makefile
#
# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <[email protected]>
# SPDX-License-Identifier: Apache-2.0
SHELL = bash -eu -o pipefail
.DEFAULT_GOAL := help
.PHONY: test lint yamllint ansiblelint license help
test: ## run tests on the playbook with molecule
molecule --version
molecule test
lint: yamllint ansiblelint ## run all lint checks
# all YAML files
YAML_FILES ?= $(shell find . -type f \( -name '*.yaml' -o -name '*.yml' \) -print )
yamllint: ## lint check with yamllint
yamllint --version
yamllint \
-d "{extends: default, rules: {line-length: {max: 119}}}" \
-s $(YAML_FILES)
# List of molecule files, not including base molecule.yml which isn't ansible format
MOLECULE_FILES ?= $(shell find molecule -type f -name '*.yml' \! -name 'molecule.yml' -print )
ansiblelint: ## lint check with ansible-lint
ansible-lint --version
ansible-lint -v .
ansible-lint -v $(MOLECULE_FILES)
license: ## Check license with the reuse tool
reuse --version
reuse --root . lint
help: ## Print help for each target
@echo pxeboot test targets
@echo
@grep '^[[:alnum:]_-]*:.* ##' $(MAKEFILE_LIST) \
| sort | awk 'BEGIN {FS=":.* ## "}; {printf "%-25s %s\n", $$1, $$2};'