From 27364b18c8d8b3f806e353fd519cdf48f9a99ab7 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Tue, 10 Oct 2023 23:25:34 +1300 Subject: [PATCH] Add Makefule for convenient local tests --- Makefile | 38 ++++++++++++++++++++++++++++++++++++++ requirements.txt | 6 ++++++ requirements.yml | 3 +++ 3 files changed, 47 insertions(+) create mode 100644 Makefile create mode 100644 requirements.txt create mode 100644 requirements.yml diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6fc8bd3 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +.PHONY: clean virtualenv lint test docker dist dist-upload + +clean: + find . -name '*.py[co]' -delete + +virtualenv: + virtualenv --prompt '|> ansible-role-auth-duo <| ' .venv + .venv/bin/pip install -r requirements.txt + .venv/bin/ansible-galaxy collection install -r requirements.yml + @echo + @echo "VirtualENV Setup Complete. Now run: source .venv/bin/activate" + @echo + +test: + for distro in centos7 almalinux8 ; do \ + MOLECULE_DISTRO=$$distro molecule test --all ; \ + done + +lint: + @echo + @echo "Linting with Ansible-lint" + @echo + ansible-lint . + yamllint . + + +docker: clean + docker buildx build --platform 'linux/amd64,linux/arm64' --push \ + -t hub.cybercinch.nz/cybercinch/imap_retention_manager:latest \ + -t docker.io/cybercinch/imap_retention_manager:latest . + +dist: clean + rm -rf dist/* + python setup.py sdist + python setup.py bdist_wheel + +dist-upload: + twine upload dist/* diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0607ebf --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +ansible-core<2.17 +ansible-compat<4 +molecule[docker]<5.0.0 +ansible-lint==6.16.2 +yamllint==1.32.0 +passlib==1.7.4 \ No newline at end of file diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 0000000..34f8eba --- /dev/null +++ b/requirements.yml @@ -0,0 +1,3 @@ +collections: + - ansible.windows + - community.general