enroll/tests.sh
Miguel Jacq 55e50ebf59
All checks were successful
CI / test (push) Successful in 5m11s
Lint / test (push) Successful in 27s
Trivy / test (push) Successful in 17s
Fix end of file/whitespace per pre-commit
2025-12-18 13:50:00 +11:00

24 lines
469 B
Bash
Executable file

#!/bin/bash
set -eo pipefail
# Pytests
poetry run pytest -vvvv --cov=enroll --cov-report=term-missing --disable-warnings
BUNDLE_DIR="/tmp/bundle"
ANSIBLE_DIR="/tmp/ansible"
rm -rf "${BUNDLE_DIR}" "${ANSIBLE_DIR}"
# Generate data
poetry run \
enroll single-shot \
--harvest "${BUNDLE_DIR}" \
--out "${ANSIBLE_DIR}"
builtin cd "${ANSIBLE_DIR}"
# Lint
ansible-lint "${ANSIBLE_DIR}"
# Run
ansible-playbook playbook.yml -i "localhost," -c local --check --diff