-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmake.py
More file actions
68 lines (51 loc) · 1.72 KB
/
make.py
File metadata and controls
68 lines (51 loc) · 1.72 KB
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
import os
import sys
import platform
if os.getuid() is not 0:
print "only run this program as 'root'"
sys.exit(1)
if platform.system() == 'Windows':
print 'cannot use this program in Windows'
sys.exit(1)
root = sys.argv[0]
osInfo = platform.dist()
if osInfo[0] == 'centos':
os.system('yum -y update')
os.system('yum -y groupinstall "Development Tools"')
os.system('yum -y install gcc')
os.system('yum -y install wget')
os.system('yum -y install zlib-devel openssl-devel')
os.system('yum -y install docker')
os.system('yum -y install tar')
os.system('easy_install pip')
os.system('pip install flask')
os.system('pip install sqlalchemy')
os.system('easy_install mysql-connector-python')
os.system('pip install wtforms')
os.system('pip install celery')
os.system('pip install tornado')
os.system('pip install sqlalchemy_utils')
os.system('easy_install repoze.lru')
os.system('pip install redis')
os.system('service docker start')
os.system('chkconfig docker on')
os.system('sudo cp -r pydev /mnt/shared')
os.system('sudo cp -r gradeProgram /mnt/shared')
os.system('sudo cp -r Dockerfiles /mnt/shared')
dockerDir = root.replace('make.py', '')
if len(dockerDir) < 1:
dockerDir = './'
os.chdir(dockerDir)
os.system('tar cvfz ./Dockerfiles/GradeServer_Docker/gradeprogram.tar.gz gradeprogram/')
os.chdir('/mnt/shared/Dockerfiles/GradeServer_Docker')
print 'start building gradeserver image'
os.system('docker build -t gradeserver:1.0 .')
try:
os.makedirs('/mnt/shared')
except Exception:
pass
try:
os.makedirs('/mnt/shared/tempdir')
except Exception:
pass
#if osInfo[0] == '':