-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfabfile.py
71 lines (52 loc) · 1.7 KB
/
fabfile.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
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
import time
from fabric.api import run, env, task, put, cd, local, sudo
env.use_ssh_config = True
env.hosts = ['iota_node']
@task(default=True)
def iri():
run('mkdir -p /srv/private-tangle/')
with cd('/srv/private-tangle'):
put('.', '.')
run('docker-compose --project-name private-tangle pull')
run('docker-compose --project-name private-tangle up -d --force-recreate iri')
@task
def tools():
with cd('/srv/private-tangle'):
put('.', '.')
run('docker-compose --project-name private-tangle pull')
run('docker-compose --project-name private-tangle up -d --no-deps --force-recreate coordinator explorer')
run('docker-compose --project-name private-tangle logs -f --tail 100 coordinator explorer')
@task
def stop():
with cd('/srv/private-tangle'):
run('docker-compose --project-name private-tangle stop')
@task
def stop_coord():
with cd('/srv/private-tangle'):
run('docker-compose --project-name private-tangle stop coordinator')
@task
def down():
with cd('/srv/private-tangle'):
run('docker-compose --project-name private-tangle down -v')
@task
def logs():
with cd('/srv/private-tangle'):
run('docker-compose --project-name private-tangle logs -f --tail 100')
@task
def logs_coord():
with cd('/srv/private-tangle'):
run('docker-compose --project-name private-tangle logs -f --tail 100 coordinator')
@task
def logs_all():
with cd('/srv/private-tangle'):
run('docker-compose logs -f')
@task
def reset():
# stop services and delete database
down()
time.sleep(1)
run('rm -rf /srv/private-tangle/testnet_db/')
# restart all services
iri()
time.sleep(5)
tools()