-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
50 lines (44 loc) · 1.06 KB
/
tox.ini
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
[tox]
skipsdist = True
envlist = docker-run
[testenv]
basepython = python3.8
skip_install = True
passenv = *
envdir = {toxworkdir}/docker
whitelist_externals =
bash
cp
docker
echo
mkdir
rm
sleep
[testenv:build]
description = build from Dockerfile and start container
commands =
- bash -c "sudo ./prep.sh"
docker build --tag amc .
[testenv:run]
description = start amc
commands =
- docker container rm -f amc
; docker run -v .:/home/ob --name amc -d -p 8888:8888 amc
docker run --name amc -d -p 8888:8888 amc
; if I don't wait a bit list is empty (is there a better way?)
sleep 0.5
docker exec -it amc jupyter notebook list
[testenv:exec]
description = enter amc and start a bash shell
commands = docker exec -it amc {posargs:ipython}
[testenv:stop]
description = stop and remove amc container
commands =
docker stop amc
docker rm amc
echo "HINT: tidy up with tox -e clean"
[testenv:clean]
description = tidy up docker cruft
commands =
- bash -c "docker kill amc"
- bash -c "docker rm -v $(docker ps -qa)"