Files
cookiecutter-ansible-role/{{ cookiecutter.role_name }}/Makefile

37 lines
822 B
Makefile
Raw Normal View History

2024-01-06 23:02:10 +13:00
.PHONY: clean virtualenv lint test docker dist dist-upload
clean:
find . -name '*.py[co]' -delete
virtualenv:
2024-01-06 23:46:51 +13:00
virtualenv --prompt '|> {{ cookiecutter.role_title | lower | replace(' ','_') }} <| ' .venv
2024-01-06 23:02:10 +13:00
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -r requirements.txt
2024-01-07 11:36:06 +13:00
.venv/bin/ansible-galaxy collection install -r molecule/requirements.yml
2024-01-06 23:02:10 +13:00
@echo
@echo "VirtualENV Setup Complete. Now run: source .venv/bin/activate"
@echo
2024-01-07 11:58:10 +13:00
test:
2024-01-06 23:02:10 +13:00
for distro in almalinux9 ; do \
MOLECULE_DISTRO=$$distro molecule test --all ; \
done
lint:
@echo "Linting with Ansible-lint"
@echo
ansible-lint -c ".ansible-lint" --exclude ".venv"
@echo
@echo "Linting with Yamllint"
@echo
yamllint .
@echo
dist: clean
rm -rf dist/*
python setup.py sdist
python setup.py bdist_wheel
dist-upload:
twine upload dist/*