ci.py: Cleanup, DACA2 will be executed on other computers
This commit is contained in:
parent
0ced0c33e5
commit
5fecd4c194
70
tools/ci.py
70
tools/ci.py
|
@ -13,16 +13,6 @@ import sys
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
|
|
||||||
def wget(url):
|
|
||||||
try:
|
|
||||||
fp = urllib.urlopen(url)
|
|
||||||
data = fp.read()
|
|
||||||
return data
|
|
||||||
except IOError:
|
|
||||||
pass
|
|
||||||
return ''
|
|
||||||
|
|
||||||
|
|
||||||
# Upload file to sourceforge web server using scp
|
# Upload file to sourceforge web server using scp
|
||||||
def upload(file_to_upload, destination):
|
def upload(file_to_upload, destination):
|
||||||
try:
|
try:
|
||||||
|
@ -41,26 +31,6 @@ def upload(file_to_upload, destination):
|
||||||
except pexpect.TIMEOUT:
|
except pexpect.TIMEOUT:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Perform a 'make test' on the repo
|
|
||||||
def maketest(preclean):
|
|
||||||
if preclean == True:
|
|
||||||
subprocess.call(['make', 'clean'])
|
|
||||||
|
|
||||||
p = subprocess.Popen(
|
|
||||||
['nice', 'make', 'test'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
||||||
comm = p.communicate()
|
|
||||||
|
|
||||||
f = open('maketest.txt', 'wt')
|
|
||||||
f.write('Errors\n======\n')
|
|
||||||
f.write(comm[1] + '\n')
|
|
||||||
f.write('Output\n======\n')
|
|
||||||
f.write(comm[0] + '\n')
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
upload('maketest.txt', 'htdocs/devinfo/')
|
|
||||||
|
|
||||||
|
|
||||||
# git push
|
# git push
|
||||||
def gitpush():
|
def gitpush():
|
||||||
try:
|
try:
|
||||||
|
@ -124,40 +94,7 @@ def gitpull():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def daca2report():
|
|
||||||
print('Generate DACA2 report')
|
|
||||||
subprocess.call(['rm', '-rf', 'daca2-report'])
|
|
||||||
subprocess.call(['mkdir', 'daca2-report'])
|
|
||||||
subprocess.call(['python', 'tools/daca2-report.py', 'daca2-report'])
|
|
||||||
upload('-r daca2-report', 'htdocs/devinfo/')
|
|
||||||
|
|
||||||
def daca2(foldernum):
|
|
||||||
folders = '0123456789abcdefghijklmnopqrstuvwxyz'
|
|
||||||
folder = folders[foldernum % len(folders)]
|
|
||||||
|
|
||||||
print('Daca2 folder=' + folder)
|
|
||||||
|
|
||||||
p = subprocess.Popen(['git', 'show', '--format=%h'],
|
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
||||||
comm = p.communicate()
|
|
||||||
rev = comm[0]
|
|
||||||
rev = rev[:rev.find('\n')]
|
|
||||||
|
|
||||||
subprocess.call(
|
|
||||||
['make', 'clean'])
|
|
||||||
subprocess.call(
|
|
||||||
['nice', 'make', 'SRCDIR=build', 'CFGDIR=' + os.path.expanduser('~/cppcheck/cfg'), 'CXXFLAGS=-O2', 'CPPFLAGS=-DMAXTIME=600'])
|
|
||||||
subprocess.call(
|
|
||||||
['mv', 'cppcheck', os.path.expanduser('~/daca2/cppcheck-O2')])
|
|
||||||
|
|
||||||
subprocess.call(['python', 'tools/daca2.py', folder, '--rev=' + rev])
|
|
||||||
daca2report()
|
|
||||||
subprocess.call(
|
|
||||||
['python', 'tools/daca2.py', 'lib' + folder, '--rev=' + rev])
|
|
||||||
daca2report()
|
|
||||||
|
|
||||||
t0 = datetime.date.today()
|
t0 = datetime.date.today()
|
||||||
foldernum = 0
|
|
||||||
while True:
|
while True:
|
||||||
if datetime.date.today() != t0:
|
if datetime.date.today() != t0:
|
||||||
print("generate daily reports")
|
print("generate daily reports")
|
||||||
|
@ -167,10 +104,3 @@ while True:
|
||||||
if gitpull() == True:
|
if gitpull() == True:
|
||||||
print("make test")
|
print("make test")
|
||||||
# maketest(False) # Integral make test build
|
# maketest(False) # Integral make test build
|
||||||
|
|
||||||
cmd = wget('http://cppcheck.sourceforge.net/cgi-bin/ci.cgi?clear')
|
|
||||||
if cmd.find("doxygen") >= 0:
|
|
||||||
generate_webreport()
|
|
||||||
|
|
||||||
daca2(foldernum)
|
|
||||||
foldernum = foldernum + 1
|
|
||||||
|
|
Loading…
Reference in New Issue