diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2018-01-03 13:58:14 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2018-01-03 13:58:14 +0300 |
commit | 6997c2d2dce03f0b85f17e1a3ef18ce319047ecd (patch) | |
tree | a927cbd5203f79cd09aa2679bee93aacb48c77d8 /Jenkinsfile | |
parent | f6168c07f09a8d76e290b3616de15d077c9b1ef7 (diff) |
Add timeout for Jenkinsfile
Diffstat (limited to 'Jenkinsfile')
-rw-r--r-- | Jenkinsfile | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 6408cbf9b2..20c7303719 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,45 +1,47 @@ -parallel_nodes(['linux && cura', 'windows && cura']) { - // Prepare building - stage('Prepare') { - // Ensure we start with a clean build directory. - step([$class: 'WsCleanup']) +timeout(time: 2, unit: "HOURS") { + parallel_nodes(['linux && cura', 'windows && cura']) { + // Prepare building + stage('Prepare') { + // Ensure we start with a clean build directory. + step([$class: 'WsCleanup']) - // Checkout whatever sources are linked to this pipeline. - checkout scm - } + // Checkout whatever sources are linked to this pipeline. + checkout scm + } - // If any error occurs during building, we want to catch it and continue with the "finale" stage. - catchError { - // Building and testing should happen in a subdirectory. - dir('build') { - // Perform the "build". Since Uranium is Python code, this basically only ensures CMake is setup. - stage('Build') { - def branch = env.BRANCH_NAME - if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) { - branch = "master" - } + // If any error occurs during building, we want to catch it and continue with the "finale" stage. + catchError { + // Building and testing should happen in a subdirectory. + dir('build') { + // Perform the "build". Since Uranium is Python code, this basically only ensures CMake is setup. + stage('Build') { + def branch = env.BRANCH_NAME + if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}")) { + branch = "master" + } - // Ensure CMake is setup. Note that since this is Python code we do not really "build" it. - def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}") - cmake("..", "-DCMAKE_PREFIX_PATH=\"${env.CURA_ENVIRONMENT_PATH}/${branch}\" -DCMAKE_BUILD_TYPE=Release -DURANIUM_DIR=\"${uranium_dir}\"") - } + // Ensure CMake is setup. Note that since this is Python code we do not really "build" it. + def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}") + cmake("..", "-DCMAKE_PREFIX_PATH=\"${env.CURA_ENVIRONMENT_PATH}/${branch}\" -DCMAKE_BUILD_TYPE=Release -DURANIUM_DIR=\"${uranium_dir}\"") + } - // Try and run the unit tests. If this stage fails, we consider the build to be "unstable". - stage('Unit Test') { - try { - make('test') - } catch(e) { - currentBuild.result = "UNSTABLE" + // Try and run the unit tests. If this stage fails, we consider the build to be "unstable". + stage('Unit Test') { + try { + make('test') + } catch(e) { + currentBuild.result = "UNSTABLE" + } } } } - } - // Perform any post-build actions like notification and publishing of unit tests. - stage('Finalize') { - // Publish the test results to Jenkins. - junit allowEmptyResults: true, testResults: 'build/junit*.xml' + // Perform any post-build actions like notification and publishing of unit tests. + stage('Finalize') { + // Publish the test results to Jenkins. + junit allowEmptyResults: true, testResults: 'build/junit*.xml' - notify_build_result(env.CURA_EMAIL_RECIPIENTS, '#cura-dev', ['master', '2.']) + notify_build_result(env.CURA_EMAIL_RECIPIENTS, '#cura-dev', ['master', '2.']) + } } } |