test_linux_containers/Taskfile.yml
emil 48ac6c0651 Automate the execution of all molecule scenarios (#17)
# Context

This PR implements the following [issue](#12).

# Acceptance criteria

- [ ] A Task task for running all Ansible Molecule scenarios has been introduced.
- [ ] A Task task for running selected Ansible Molecule scenarios has been introduced.
- [ ] `README.md` has been updated to provide correct guidance on executing Ansible Molecule scenarios.

Co-authored-by: emo <esimeonov@gmail.com>
Reviewed-on: #17
2024-03-04 23:59:02 +00:00

31 lines
762 B
YAML

---
version: '3'
tasks:
init-project:
cmds: [pipenv install, pipenv install --dev]
pipenv-shell:
cmds: [pipenv shell]
format-yml:
cmds: [yamlfix .]
lint-yml:
deps: [format-yml]
cmds: [yamllint .]
lint-ansible:
deps: [lint-yml]
cmds: [LC_ALL=C.UTF-8 ansible-lint .]
init-tests:
cmds:
- LC_ALL=C.UTF-8 ansible-galaxy install -r requirements-test.yml --force
test-all:
deps: [init-tests]
dir: extensions
cmds:
- |
LC_ALL=C.UTF-8 \
LTE_CONTAINER_NAME={{ .LTE_CONTAINER_NAME }} \
LTE_CONTAINER_ROOT_PWD={{ .LTE_CONTAINER_ROOT_PWD }} \
molecule test --all
vars:
LTE_CONTAINER_NAME:
sh: cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1