Merge pull request #6109 from lmskater/add-jenkins-job-configs

[Jenkins][ci skip]: add jenkins job configs
This commit is contained in:
James Chen 2014-04-02 17:14:26 +08:00
commit 18648434ac
14 changed files with 212 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import os
os.system('git checkout develop')
os.system('git pull origin develop')
print('in building, run autotest.py.')
ret = os.system('python -u tools/jenkins-scripts/autotest.py')
os.system('git reset --hard')
print ret
if(ret > 0):
ret = 1
exit(ret)

View File

@ -0,0 +1,21 @@
import os
import platform
print 'Build Config:'
print ' Branch:develop'
print ' Target:Android'
print ' build script:python build/android-build.py all'
if(os.path.exists('build/android-build.py') == False):
node_name = os.environ['NODE_NAME']
source_dir = '../cocos-2dx-develop-base-repo/node/' + node_name + "/."
os.system("cp -r" + source_dir + " .")
os.system('git pull origin develop')
os.system('git submodule update --init --force')
ret = os.system('python build/android-build.py -n -j8 all')
os.system('git clean -xdf -f')
print 'build exit'
print ret
if ret == 0:
exit(0)
else:
exit(1)

View File

@ -0,0 +1,22 @@
import os
import sys
def check_ret(ret):
if(ret != 0):
os.system('git checkout -B develop remotes/origin/develop')
os.system('git clean -xdf -f')
sys.exit(1)
branchs = ['develop', 'master']
for item in branchs:
os.system('git clean -xdf -f')
os.system('git checkout -B ' + item + ' remotes/origin/' + item)
os.system('git clean -xdf -f')
ret = os.system('git pull origin')
check_ret(ret)
ret = os.system('git submodule update --init --force')
check_ret(ret)
#back to develop
os.system('git checkout -B develop remotes/origin/develop')
os.system('git clean -xdf -f')

View File

@ -0,0 +1,20 @@
import os
print 'Build Config:'
print ' Host:MAC'
print ' Branch:develop'
print ' Target:iOS'
if(os.path.exists('tools/jenkins-scripts/ios-build.sh') == False):
node_name = os.environ['NODE_NAME']
source_dir = '../cocos-2dx-develop-base-repo/node/' + node_name + "/."
os.system("cp -r " + source_dir + " .")
os.system('git pull origin develop')
os.system('git submodule update --init --force')
ret = os.system('tools/jenkins-scripts/ios-build.sh')
os.system('git clean -xdf -f')
print 'build exit'
print ret
if ret == 0:
exit(0)
else:
exit(1)

View File

@ -0,0 +1,24 @@
import os
import subprocess
import sys
print 'Build Config:'
print ' Host:win7 x86'
print ' Branch:develop'
print ' Target:win32'
print ' "%VS110COMNTOOLS%..\IDE\devenv.com" "build\cocos2d-win32.vc2012.sln" /Build "Debug|Win32"'
if(os.path.exists('build/cocos2d-win32.vc2012.sln') == False):
node_name = os.environ['NODE_NAME']
source_dir = '../cocos-2dx-develop-base-repo/node/' + node_name
source_dir = source_dir.replace("/", os.sep)
os.system("xcopy " + source_dir + " . /E /Y /H")
os.system('git pull origin develop')
os.system('git submodule update --init --force')
ret = subprocess.call('"%VS110COMNTOOLS%..\IDE\devenv.com" "build\cocos2d-win32.vc2012.sln" /Build "Debug|Win32"', shell=True)
os.system('git clean -xdf -f')
print 'build exit'
print ret
if ret == 0:
exit(0)
else:
exit(1)

View File

@ -0,0 +1,24 @@
import os
import platform
print 'Build Config:'
print ' Branch:develop'
print ' Target:Doxygen'
print ' doxygen doxygen.config'
if(os.path.exists('docs/doxygen.config') == False):
node_name = os.environ['NODE_NAME']
source_dir = '../cocos-2dx-develop-base-repo/node/' + node_name
source_dir = source_dir.replace("/", os.sep)
os.system("xcopy " + source_dir + " . /E /Y /H")
os.system('git pull origin develop')
os.system('git submodule update --init --force')
os.chdir('docs/')
ret = os.system('doxygen doxygen.config')
os.chdir('../')
os.system('git clean -xdf -f')
print 'build exit'
print ret
if ret == 0:
exit(0)
else:
exit(1)

View File

@ -0,0 +1,8 @@
import os
#os.system('git checkout develop')
#os.system('git pull origin develop')
ret = os.system('python -u tools/jenkins-scripts/job-comment-trigger.py')
if ret == 0:
exit(0)
else:
exit(1)

View File

@ -0,0 +1,8 @@
import os
#os.system('git checkout develop')
#os.system('git pull origin develop')
ret = os.system('python -u tools/jenkins-scripts/job-trigger.py')
if ret == 0:
exit(0)
else:
exit(1)

View File

@ -0,0 +1,21 @@
import os
import platform
if(os.path.exists('tools/jenkins-scripts/pull-request-builder.py') == False):
node_name = os.environ['NODE_NAME']
source_dir = '../../../cocos-2dx-develop-base-repo/node/' + node_name
if(platform.system() == 'Windows'):
source_dir = source_dir.replace("/", os.sep)
os.system("xcopy " + source_dir + ' . /E /Y /H')
else:
os.system("cp -r " + source_dir + "/. .")
os.system('git reset --hard')
os.system('git checkout develop')
os.system('git reset --hard')
os.system('git pull origin develop')
ret = os.system('python -u tools/jenkins-scripts/pull-request-builder.py')
os.system('git reset --hard')
print ret
if(ret > 0):
ret = 1
exit(ret)

View File

@ -0,0 +1,12 @@
import os
os.system('git checkout develop')
os.system('git pull origin develop')
os.system('git submodule update')
print('in building, run cocos-console-test.py.')
#ret=0
ret = os.system('python -u tools/jenkins-scripts/cocos-console-test.py')
os.system('git reset --hard')
print ret
if(ret > 0):
ret = 1
exit(ret)

View File

@ -0,0 +1,8 @@
import os
import sys
ret = os.system('git pull origin master')
if(ret != 0):
sys.exit(1)
ret = os.system('git submodule update --init --force')
if(ret != 0):
sys.exit(1)

View File

@ -0,0 +1,30 @@
import os
import platform
if(os.path.exists('CocoStudio/CSX/CSX/CSX.pro') == False):
node_name = os.environ['NODE_NAME']
source_dir = '../../../cocostudiox-base-repo/node/' + node_name
if(platform.system() == 'Windows'):
source_dir = source_dir.replace("/", os.sep)
os.system("xcopy " + source_dir + ' . /E /Y /H')
else:
os.system("cp -r " + source_dir + "/. .")
os.system('git pull origin')
os.system('git submodule update --init --force')
node_name = os.environ['NODE_NAME']
os.chdir('CocoStudio/CSX/CSX')
ret = os.system('qmake -r')
if(ret == 0):
if(node_name == 'android_mac'):
ret = os.system('make -j8')
elif(node_name == 'win32_win7'):
ret = os.system('mingw32-make -j8')
os.chdir('../../..')
os.system('git clean -xdf')
os.system('git reset --hard')
print ret
if(ret > 0):
ret = 1
exit(ret)

View File

@ -0,0 +1,2 @@
import os
os.system("python -u tools/jenkins-scripts/watchdog.py")

View File

@ -0,0 +1,2 @@
import os
os.system("python -u update-jenkins-scripts.py")