forked from ZickZakk/HTWK_SmartDriving_2016
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-config.py
38 lines (26 loc) · 908 Bytes
/
deploy-config.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
################################################################################
# Dieses Script installiert die Smart-Driving Konfiguration auf dem Auto #
################################################################################
import os
import subprocess
import shutil
CONFIG = 'DEBUG'
ADTF_DIR = '/opt/adtf/2.13.1/'
ARCHIVE_NAME = './deploy.tar.gz'
CLEANUP_FOLDER = ['./configuration_files/']
print ''
print '> deploying'
print '> pre build cleanup'
for f in CLEANUP_FOLDER:
if os.path.isdir(f):
shutil.rmtree(f)
print '> executing unpack'
extract_process = subprocess.Popen(['tar', '-xf', ARCHIVE_NAME],
cwd='./',
env={'PATH': os.environ['PATH']})
return_code = extract_process.wait()
if return_code > 0:
exit(return_code)
print '> after build cleanup'
os.remove(ARCHIVE_NAME)
print '> done'