-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
32 lines (28 loc) · 920 Bytes
/
tasks.py
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
"""This files is the replacement of Makefile."""
import shutil
from invoke import task
@task
def clean(ctx, docs=False, bytecode=False, extra=''):
"""Remove all created files."""
patterns = ['build']
if docs:
patterns.append('docs/_build')
if bytecode:
patterns.append('**/*.pyc')
if extra:
patterns.append(extra)
for pattern in patterns:
ctx.run("rm -rf {}".format(pattern))
@task
def build(ctx, docs=False):
"""Build this software."""
ctx.run("python setup.py build")
if docs:
ctx.run("sphinx-build docs docs/_build")
@task
def check_dependencies(ctx):
"""Checking all necessary binaries to build and deploy this software."""
dependencies = ['python3', 'minikube', 'docker', 'git', 'helm', 'kubectl']
for dependency in dependencies:
if not shutil.which(dependency):
print("Please install %s" % dependency)