forked from andreygubarev/molecule-qemu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.51 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
MAKEFILE_DIR := $(realpath $(dir $(firstword $(MAKEFILE_LIST))))
VIRTUALENV_VENV ?= $(MAKEFILE_DIR)/.venv
VIRTUALENV_PYTHON := $(VIRTUALENV_VENV)/bin/python3
VIRTUALENV_PIP := $(VIRTUALENV_PYTHON) -m pip
VIRTUALENV_MOLECULE := $(VIRTUALENV_VENV)/bin/molecule
.PHONY: help
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
$(VIRTUALENV_VENV):
python3 -m venv $(VIRTUALENV_VENV)
$(VIRTUALENV_PIP) install \
'ansible-lint==6.16.1' \
'pycodestyle==2.10.0'
.PHONY: virtualenv
virtualenv: $(VIRTUALENV_VENV) ## Create local environment
.PHONY: lint
lint: virtualenv ## Lint
$(VIRTUALENV_VENV)/bin/ansible-lint -v molecule_qemu
$(VIRTUALENV_VENV)/bin/pycodestyle molecule_qemu
.PHONY: test ## Test
test:
$(VIRTUALENV_PIP) install -e .
cd tests && $(VIRTUALENV_MOLECULE) test
.PHONY: test-%
test-%: virtualenv
$(VIRTUALENV_PIP) install -e .
cd tests && $(VIRTUALENV_MOLECULE) test -s $*
.PHONY: test-network
test-network: test-network-shared test-network-user ## Test network
.PHONY: test-os-debian
test-os-debian: test-os-debian-bullseye test-os-debian-bookworm ## Test Debian OS
.PHONY: test-os-ubuntu
test-os-ubuntu: test-os-ubuntu-focal test-os-ubuntu-jammy ## Test Ubuntu OS
.PHONY: test-os
test-os: test-os-debian test-os-ubuntu ## Test OS
.PHONY: test-platform
test-platform: test-platform-amd64 test-platform-arm64 ## Test platform
.PHONY: clean
clean: ## Remove cache
rm -rf $(VIRTUALENV_VENV) build dist *.egg-info