aboutsummaryrefslogtreecommitdiff
path: root/dodo.py
diff options
context:
space:
mode:
authorbozo.kopic <bozo.kopic@gmail.com>2020-04-11 20:21:24 +0200
committerbozo.kopic <bozo.kopic@gmail.com>2020-04-11 20:21:24 +0200
commit56a75fcb8f5a9e4c05ccec8eb4a3345a115da441 (patch)
treefb47ceaa9da22713898e28e61f95d5ca670ee95a /dodo.py
parentd950fe9c67ec052ce13f54c50c25387b61c3ce32 (diff)
docker build
Diffstat (limited to 'dodo.py')
-rw-r--r--dodo.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/dodo.py b/dodo.py
index 176a393..5951fb7 100644
--- a/dodo.py
+++ b/dodo.py
@@ -28,6 +28,8 @@ dist_dir = Path('dist')
py_build_dir = build_dir / 'py'
js_build_dir = build_dir / 'js'
+docker_img = 'bozokopic/opcut'
+
def task_clean_all():
"""Clean all"""
@@ -110,6 +112,27 @@ def task_dist():
'task_dep': ['py_build']}
+def task_docker_build():
+ """Create docker image"""
+ def build():
+ version = _get_version()
+ subprocess.run(['docker', 'build', '-t', f'{docker_img}:{version}',
+ '.'],
+ check=True)
+
+ return {'actions': [build]}
+
+
+def task_docker_upload():
+ """Upload docker image"""
+ def upload():
+ version = _get_version()
+ subprocess.run(['docker', 'push', f'{docker_img}:{version}'],
+ check=True)
+
+ return {'actions': [upload]}
+
+
def _create_setup_py(path):
version = _get_version()
readme = _get_readme()