From 8bf0ff7897b9c03d4a67232dbe64cb51f451a954 Mon Sep 17 00:00:00 2001 From: lm Date: Wed, 2 Apr 2014 15:21:44 +0800 Subject: [PATCH] [Jenkins][ci skip]: add jenkins job configs --- tools/jenkins-scripts/configs/autotest.py | 10 +++++++ .../configs/cocos-2dx-develop-android.py | 21 +++++++++++++ .../configs/cocos-2dx-develop-base-repo.py | 22 ++++++++++++++ .../configs/cocos-2dx-develop-ios.py | 20 +++++++++++++ .../configs/cocos-2dx-develop-win32.py | 24 +++++++++++++++ .../configs/cocos-2dx-doxygen.py | 24 +++++++++++++++ ...-2dx-pull-request-build-comment-trigger.py | 8 +++++ .../cocos-2dx-pull-request-build-trigger.py | 8 +++++ .../configs/cocos-2dx-pull-request-build.py | 21 +++++++++++++ .../configs/cocos2d-console-test.py | 12 ++++++++ .../configs/cocostudiox-base-repo.py | 8 +++++ .../configs/cocostudiox-daily-build.py | 30 +++++++++++++++++++ .../configs/jenkins-job-watchdog.py | 2 ++ .../configs/manual-update-jenkins-scripts.py | 2 ++ 14 files changed, 212 insertions(+) create mode 100644 tools/jenkins-scripts/configs/autotest.py create mode 100644 tools/jenkins-scripts/configs/cocos-2dx-develop-android.py create mode 100644 tools/jenkins-scripts/configs/cocos-2dx-develop-base-repo.py create mode 100644 tools/jenkins-scripts/configs/cocos-2dx-develop-ios.py create mode 100644 tools/jenkins-scripts/configs/cocos-2dx-develop-win32.py create mode 100644 tools/jenkins-scripts/configs/cocos-2dx-doxygen.py create mode 100644 tools/jenkins-scripts/configs/cocos-2dx-pull-request-build-comment-trigger.py create mode 100644 tools/jenkins-scripts/configs/cocos-2dx-pull-request-build-trigger.py create mode 100644 tools/jenkins-scripts/configs/cocos-2dx-pull-request-build.py create mode 100644 tools/jenkins-scripts/configs/cocos2d-console-test.py create mode 100644 tools/jenkins-scripts/configs/cocostudiox-base-repo.py create mode 100644 tools/jenkins-scripts/configs/cocostudiox-daily-build.py create mode 100644 tools/jenkins-scripts/configs/jenkins-job-watchdog.py create mode 100644 tools/jenkins-scripts/configs/manual-update-jenkins-scripts.py diff --git a/tools/jenkins-scripts/configs/autotest.py b/tools/jenkins-scripts/configs/autotest.py new file mode 100644 index 0000000000..5e6a6098a8 --- /dev/null +++ b/tools/jenkins-scripts/configs/autotest.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocos-2dx-develop-android.py b/tools/jenkins-scripts/configs/cocos-2dx-develop-android.py new file mode 100644 index 0000000000..e632c330c5 --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos-2dx-develop-android.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocos-2dx-develop-base-repo.py b/tools/jenkins-scripts/configs/cocos-2dx-develop-base-repo.py new file mode 100644 index 0000000000..f70b31d568 --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos-2dx-develop-base-repo.py @@ -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') diff --git a/tools/jenkins-scripts/configs/cocos-2dx-develop-ios.py b/tools/jenkins-scripts/configs/cocos-2dx-develop-ios.py new file mode 100644 index 0000000000..7a0c672f47 --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos-2dx-develop-ios.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocos-2dx-develop-win32.py b/tools/jenkins-scripts/configs/cocos-2dx-develop-win32.py new file mode 100644 index 0000000000..801874494e --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos-2dx-develop-win32.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocos-2dx-doxygen.py b/tools/jenkins-scripts/configs/cocos-2dx-doxygen.py new file mode 100644 index 0000000000..4367230caf --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos-2dx-doxygen.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build-comment-trigger.py b/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build-comment-trigger.py new file mode 100644 index 0000000000..e7817809c5 --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build-comment-trigger.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build-trigger.py b/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build-trigger.py new file mode 100644 index 0000000000..60c79ddc94 --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build-trigger.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build.py b/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build.py new file mode 100644 index 0000000000..3f387c4916 --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos-2dx-pull-request-build.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocos2d-console-test.py b/tools/jenkins-scripts/configs/cocos2d-console-test.py new file mode 100644 index 0000000000..26a2492a2f --- /dev/null +++ b/tools/jenkins-scripts/configs/cocos2d-console-test.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocostudiox-base-repo.py b/tools/jenkins-scripts/configs/cocostudiox-base-repo.py new file mode 100644 index 0000000000..91aeb02ee0 --- /dev/null +++ b/tools/jenkins-scripts/configs/cocostudiox-base-repo.py @@ -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) diff --git a/tools/jenkins-scripts/configs/cocostudiox-daily-build.py b/tools/jenkins-scripts/configs/cocostudiox-daily-build.py new file mode 100644 index 0000000000..00cf754f82 --- /dev/null +++ b/tools/jenkins-scripts/configs/cocostudiox-daily-build.py @@ -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) diff --git a/tools/jenkins-scripts/configs/jenkins-job-watchdog.py b/tools/jenkins-scripts/configs/jenkins-job-watchdog.py new file mode 100644 index 0000000000..341cbd6adc --- /dev/null +++ b/tools/jenkins-scripts/configs/jenkins-job-watchdog.py @@ -0,0 +1,2 @@ +import os +os.system("python -u tools/jenkins-scripts/watchdog.py") diff --git a/tools/jenkins-scripts/configs/manual-update-jenkins-scripts.py b/tools/jenkins-scripts/configs/manual-update-jenkins-scripts.py new file mode 100644 index 0000000000..2b770f56ae --- /dev/null +++ b/tools/jenkins-scripts/configs/manual-update-jenkins-scripts.py @@ -0,0 +1,2 @@ +import os +os.system("python -u update-jenkins-scripts.py")