-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
94 lines (78 loc) · 2.42 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This file was written by Damien Dart, <[email protected]>. This is
# free and unencumbered software released into the public domain. For
# more information, please refer to the accompanying "UNLICENCE" file.
---
version: '3'
output: 'prefixed'
tasks:
default:
deps:
- task: 'ci'
ci:
cmds:
- task: 'dependencies'
- task: 'lint'
desc: 'Run all CI-related tasks'
dependencies:
cmds:
- task: 'dependencies:packer'
- task: 'dependencies:python'
desc: 'Install project dependencies'
dependencies:python:
cmds:
- '.venv/bin/python -m pip install -r requirements.txt'
desc: 'Install Python dependencies'
dependencies:packer:
cmds:
- 'packer init misc/packer/*.hcl'
desc: 'Install Packer plugin binaries'
lint:
cmds:
- task: 'lint:ansible'
- task: 'lint:packer'
- task: 'lint:python'
- task: 'lint:shell'
- task: 'lint:yaml'
desc: 'Run all linting-related tasks'
lint:ansible:
cmds:
- cmd: '.venv/bin/ansible-lint -p --nocolor playbook-deploy-website.yml'
- cmd: '.venv/bin/ansible-lint -p --nocolor playbook-package-maintainance.yml'
- cmd: '.venv/bin/ansible-lint -p --nocolor playbook-provision.yml'
desc: 'Lint Ansible-related files with Ansible Lint'
lint:packer:
cmds:
- 'packer validate misc/packer/*.hcl'
desc: 'Lint Packer templates with Packer'
lint:python:
cmds:
- task: 'lint:python:black'
- task: 'lint:python:flake8'
desc: 'Run all Python-linting tasks'
lint:python:black:
cmds:
- '.venv/bin/black --check --diff roles/*/*/*.py tests/*.py'
desc: 'Lint Python scripts with Black'
lint:python:flake8:
cmds:
- '.venv/bin/flake8 roles/*/*/*.py* tests/*.py'
desc: 'Lint Python scripts with Flake8'
lint:shell:
cmds:
- 'shellcheck roles/*/*/*.sh*'
desc: 'Lint shell scripts with ShellCheck'
lint:yaml:
cmds:
- '.venv/bin/yamllint -s -f parsable . .github'
desc: 'Lint YAML files with yamllint'
start:
cmds:
- 'python3.13 -m venv .venv'
- cmd: |
if [ -z "$VIRTUAL_ENV" ]; then
echo "Run \"source .venv/bin/activate\" to activate the virtual environment"
else
echo "Active Python virtual environment: $VIRTUAL_ENV"
fi
silent: true
desc: 'Create a Python virtual environment for development, running Ansible, and testing'