From ff1f8b34bec9a028b45676f9023dfbb2ae729544 Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Fri, 17 Mar 2017 12:55:41 -0700 Subject: [PATCH] Try adding a timeout to the Jenkinsfile (#2378) --- Jenkinsfile | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f06ed427ba..84f0349a4d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,23 +1,25 @@ wrappedNode(label: 'linux && x86_64') { - deleteDir() - stage "checkout" - checkout scm - sh "git submodule update --init --recursive" - stage "test" + timeout(time: 60, unit: 'MINUTES') { + deleteDir() + stage "checkout" + checkout scm + sh "git submodule update --init --recursive" + stage "test" - /* Jekyll creates html files to implement client side redirects. - There are absolute links to docs.docker.com in these htmls - we don't want them to be parsed by the tests for now. - Removing jekyll-redirect-from option will make sure these pages - are not generated when building with Jekyll. */ - sh "awk '/jekyll-redirect-from/{n=1}; n {n--; next}; 1' < _config.yml > _config.yml.tmp" - sh "mv _config.yml.tmp _config.yml" + /* Jekyll creates html files to implement client side redirects. + There are absolute links to docs.docker.com in these htmls + we don't want them to be parsed by the tests for now. + Removing jekyll-redirect-from option will make sure these pages + are not generated when building with Jekyll. */ + sh "awk '/jekyll-redirect-from/{n=1}; n {n--; next}; 1' < _config.yml > _config.yml.tmp" + sh "mv _config.yml.tmp _config.yml" - sh "docker build -t docs:${JOB_BASE_NAME}-${BUILD_NUMBER} `pwd`" - sh "docker build -t tests:${JOB_BASE_NAME}-${BUILD_NUMBER} `pwd`/tests" - sh "docker run -v /usr/src/app/allvbuild --name docs-${JOB_BASE_NAME}-${BUILD_NUMBER} docs:${JOB_BASE_NAME}-${BUILD_NUMBER} /bin/true" - sh "docker run --rm --volumes-from docs-${JOB_BASE_NAME}-${BUILD_NUMBER} -v `pwd`:/docs tests:${JOB_BASE_NAME}-${BUILD_NUMBER}" - sh "docker rm -fv docs-${JOB_BASE_NAME}-${BUILD_NUMBER}" - sh "docker rmi docs:${JOB_BASE_NAME}-${BUILD_NUMBER} tests:${JOB_BASE_NAME}-${BUILD_NUMBER}" - deleteDir() + sh "docker build -t docs:${JOB_BASE_NAME}-${BUILD_NUMBER} `pwd`" + sh "docker build -t tests:${JOB_BASE_NAME}-${BUILD_NUMBER} `pwd`/tests" + sh "docker run -v /usr/src/app/allvbuild --name docs-${JOB_BASE_NAME}-${BUILD_NUMBER} docs:${JOB_BASE_NAME}-${BUILD_NUMBER} /bin/true" + sh "docker run --rm --volumes-from docs-${JOB_BASE_NAME}-${BUILD_NUMBER} -v `pwd`:/docs tests:${JOB_BASE_NAME}-${BUILD_NUMBER}" + sh "docker rm -fv docs-${JOB_BASE_NAME}-${BUILD_NUMBER}" + sh "docker rmi docs:${JOB_BASE_NAME}-${BUILD_NUMBER} tests:${JOB_BASE_NAME}-${BUILD_NUMBER}" + deleteDir() + } }