Newer
Older
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
#!/usr/bin/env python
# coding=utf-8
"""
fabric file for server automation.
Usage:
fab deploy
//deploy debug build to s01 VM.
BUILDDIR=release fab deploy
//deploy release build to s01 VM.
HOST=ryzen5root fab deploy
//deploy debug build to ryzen5
HOST=ryzen5root BUILDDIR=release fab deploy
//deploy release build to ryzen5
"""
# pylint: disable=line-too-long
import warnings
import os
from fabric.api import env, sudo, run, local, hosts, put, cd
env.use_ssh_config = True
TEST_HOST = os.getenv("HOST", "s01root")
DIR = os.getenv("BUILDDIR", "build")
@hosts(TEST_HOST)
def deploy():
local("ninja -C %s" % (DIR,))
run("mkdir -p /usr/share/zero-panel/")
put("zero-panel/zero-panel.ui", "/usr/share/zero-panel/zero-panel.ui")
put("zero-panel/zero-panel.css", "/usr/share/zero-panel/zero-panel.css")
run("pkill zero-panel || true")
put("%s/zero-panel" % (DIR,), "/home/sylecn/d/zero-panel")
run("chown sylecn:sylecn /home/sylecn/d/zero-panel")
run("chmod +x /home/sylecn/d/zero-panel")
put("zero-panel/com.emacsos.zero.Panel1.service",
"/usr/share/dbus-1/services/")
run("mkdir -p /usr/share/dbus-1/interfaces/")
put("zero-panel/com.emacsos.zero.Panel1.PanelInterface.xml",
"/usr/share/dbus-1/interfaces/")
run("systemctl reload dbus")
# module init
warnings.filterwarnings(action='ignore',module='.*paramiko.*')