Skip to content

Commit 5355e3f

Browse files
committed
Change Jenkinsfile to retry clearing the workspace and compiling when anything fails
QA-5919
1 parent b86f89f commit 5355e3f

File tree

2 files changed

+39
-28
lines changed

2 files changed

+39
-28
lines changed

Jenkinsfile

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pipeline {
1111
ansiColor('xterm')
1212
buildDiscarder(logRotator(artifactNumToKeepStr: '1'))
1313
parallelsAlwaysFailFast()
14-
retry(1)
1514
skipStagesAfterUnstable()
1615
timeout(time: 60, unit: 'MINUTES')
1716
timestamps()
@@ -29,35 +28,47 @@ pipeline {
2928
}
3029
}
3130
}
32-
stage('Clean workspace') {
31+
stage('Build') {
3332
options {
34-
timeout(time: 5, unit: 'MINUTES')
35-
}
36-
steps {
37-
cleanWs deleteDirs: true, patterns: [
38-
[pattern: 'packages', type: 'INCLUDE'],
39-
[pattern: 'global-packages', type: 'INCLUDE'],
40-
[pattern: 'tmp/NuGetScratch', type: 'INCLUDE'],
41-
[pattern: 'http-cache', type: 'INCLUDE'],
42-
[pattern: 'plugins-cache', type: 'INCLUDE'],
43-
[pattern: '**/obj', type: 'INCLUDE'],
44-
[pattern: '**/bin', type: 'INCLUDE']
45-
]
46-
}
47-
}
48-
stage('Compile') {
49-
options {
50-
timeout(time: 20, unit: 'MINUTES')
33+
retry(2)
5134
}
52-
steps {
53-
withEnv(["NUGET_PACKAGES=${env.WORKSPACE}/global-packages", "temp=${env.WORKSPACE}/tmp/NuGetScratch", "NUGET_HTTP_CACHE_PATH=${env.WORKSPACE}/http-cache", "NUGET_PLUGINS_CACHE_PATH=${env.WORKSPACE}/plugins-cache", "gsExec=${gsExec}", "compareExec=${compareExec}"]) {
54-
bat "\"${env.NuGet}\" restore itext.html2pdf.sln"
55-
bat "dotnet restore itext.html2pdf.sln"
56-
bat "dotnet build itext.html2pdf.sln --configuration Release --source ${env.WORKSPACE}/packages"
57-
script {
58-
createPackAllFile(findFiles(glob: '**/*.nuspec'))
59-
load 'packAll.groovy'
35+
stages {
36+
stage('Clean workspace') {
37+
options {
38+
timeout(time: 5, unit: 'MINUTES')
39+
}
40+
steps {
41+
cleanWs deleteDirs: true, patterns: [
42+
[pattern: 'packages', type: 'INCLUDE'],
43+
[pattern: 'global-packages', type: 'INCLUDE'],
44+
[pattern: 'tmp/NuGetScratch', type: 'INCLUDE'],
45+
[pattern: 'http-cache', type: 'INCLUDE'],
46+
[pattern: 'plugins-cache', type: 'INCLUDE'],
47+
[pattern: '**/obj', type: 'INCLUDE'],
48+
[pattern: '**/bin', type: 'INCLUDE']
49+
]
50+
}
51+
}
52+
stage('Compile') {
53+
options {
54+
timeout(time: 20, unit: 'MINUTES')
6055
}
56+
steps {
57+
withEnv(["NUGET_PACKAGES=${env.WORKSPACE}/global-packages", "temp=${env.WORKSPACE}/tmp/NuGetScratch", "NUGET_HTTP_CACHE_PATH=${env.WORKSPACE}/http-cache", "NUGET_PLUGINS_CACHE_PATH=${env.WORKSPACE}/plugins-cache", "gsExec=${gsExec}", "compareExec=${compareExec}"]) {
58+
bat "\"${env.NuGet}\" restore itext.html2pdf.sln"
59+
bat "dotnet restore itext.html2pdf.sln"
60+
bat "dotnet build itext.html2pdf.sln --configuration Release --source ${env.WORKSPACE}/packages"
61+
script {
62+
createPackAllFile(findFiles(glob: '**/*.nuspec'))
63+
load 'packAll.groovy'
64+
}
65+
}
66+
}
67+
}
68+
}
69+
post {
70+
failure {
71+
sleep time: 2, unit: 'MINUTES'
6172
}
6273
}
6374
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
570e401362ea3c6c551f7628d0b8743711a169f3
1+
fd33d4e2df958f5304c18abd24e2fb42638deebd

0 commit comments

Comments
 (0)