From de589a11e0f79e9c940cf09cd6c739b8133ecabd Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Fri, 6 Oct 2023 06:57:52 +1300 Subject: [PATCH] Add Makefile --- .gitignore | 1 + Makefile | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index f5352af..56465f8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ roles/* !files/authorized_keys/ files/authorized_keys/* !files/authorized_keys/.gitkeep +env/ # Do not commit Vault password .vault_password.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..de5f320 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +.PHONY: clean virtualenv lint test docker dist dist-upload + +clean: + find . -name '*.py[co]' -delete + +virtualenv: + virtualenv --prompt '|> ansible-role-common <| ' env + env/bin/pip install -r requirements.txt + env/bin/ansible-galaxy collection install -r requirements.yml + @echo + @echo "VirtualENV Setup Complete. Now run: source env/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 . + + +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/*