Skip to content

Commit f4735b7

Browse files
committed
ci: disable default jenkins checkout
- disable the default jenkins checkout which also pulls in submodules - manually perform a clean checkout in a stage - then update submodules to avoid weird race conditions in PRs
1 parent cf21405 commit f4735b7

10 files changed

+229
-5
lines changed

ci/Jenkinsfile.android

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ pipeline {
2424
}
2525

2626
options {
27+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
28+
skipDefaultCheckout()
2729
timestamps()
2830
/* Prevent Jenkins jobs from running forever */
2931
timeout(time: 45, unit: 'MINUTES')
@@ -52,6 +54,31 @@ pipeline {
5254
}
5355

5456
stages {
57+
stage('Checkout') {
58+
steps {
59+
checkout([
60+
$class: 'GitSCM',
61+
branches: scm.branches,
62+
doGenerateSubmoduleConfigurations: false,
63+
extensions: [
64+
[$class: 'SubmoduleOption',
65+
disableSubmodules: false,
66+
parentCredentials: true,
67+
recursiveSubmodules: false,
68+
reference: '',
69+
trackingSubmodules: false
70+
]
71+
],
72+
submoduleCfg: [],
73+
userRemoteConfigs: scm.userRemoteConfigs
74+
])
75+
}
76+
}
77+
stage('Fetch submodules') {
78+
steps {
79+
sh 'git submodule update --init --recursive'
80+
}
81+
}
5582

5683
stage('Build Android APK') {
5784
steps {

ci/Jenkinsfile.combined

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pipeline {
99
agent { label 'linux' }
1010

1111
options {
12+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
13+
skipDefaultCheckout()
1214
timestamps()
1315
disableConcurrentBuilds()
1416
disableRestartFromStage()
@@ -33,6 +35,26 @@ pipeline {
3335
}
3436

3537
stages {
38+
stage('Checkout') {
39+
steps {
40+
checkout([
41+
$class: 'GitSCM',
42+
branches: scm.branches,
43+
doGenerateSubmoduleConfigurations: false,
44+
extensions: [
45+
[$class: 'SubmoduleOption',
46+
disableSubmodules: false,
47+
parentCredentials: true,
48+
recursiveSubmodules: false,
49+
reference: '',
50+
trackingSubmodules: false
51+
]
52+
],
53+
submoduleCfg: [],
54+
userRemoteConfigs: scm.userRemoteConfigs
55+
])
56+
}
57+
}
3658
stage('Cleanup Workspace') {
3759
steps {
3860
sh './scripts/clean-git.sh'

ci/Jenkinsfile.linux

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ pipeline {
5050
}
5151

5252
options {
53+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
54+
skipDefaultCheckout()
5355
timestamps()
5456
/* Prevent Jenkins jobs from running forever */
5557
timeout(time: 30, unit: 'MINUTES')
@@ -75,7 +77,7 @@ pipeline {
7577
/* Avoid weird bugs caused by stale cache. */
7678
QML_DISABLE_DISK_CACHE = "true"
7779
/* Control output the filename */
78-
VERSION = sh(script: "./scripts/version.sh", returnStdout: true).trim()
80+
VERSION = "${sh(script: 'git describe --tags', returnStdout: true).trim()}${params.USE_NWAKU ? '-nwaku-experimental' : ''}"
7981
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage', arch: getArch(), version: env.VERSION)}"
8082
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'tar.gz', arch: getArch(), version: env.VERSION)}"
8183
/* prevent sharing cache dir across different jobs */
@@ -94,6 +96,26 @@ pipeline {
9496
}
9597

9698
stages {
99+
stage('Checkout') {
100+
steps {
101+
checkout([
102+
$class: 'GitSCM',
103+
branches: scm.branches,
104+
doGenerateSubmoduleConfigurations: false,
105+
extensions: [
106+
[$class: 'SubmoduleOption',
107+
disableSubmodules: false,
108+
parentCredentials: true,
109+
recursiveSubmodules: false,
110+
reference: '',
111+
trackingSubmodules: false
112+
]
113+
],
114+
submoduleCfg: [],
115+
userRemoteConfigs: scm.userRemoteConfigs
116+
])
117+
}
118+
}
97119
stage('Cleanup Workspace') {
98120
steps {
99121
sh './scripts/clean-git.sh'

ci/Jenkinsfile.linux-nix

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ pipeline {
3838
}
3939

4040
options {
41+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
42+
skipDefaultCheckout()
4143
timestamps()
4244
/* Prevent Jenkins jobs from running forever */
4345
timeout(time: 30, unit: 'MINUTES')
@@ -63,7 +65,7 @@ pipeline {
6365
/* Avoid weird bugs caused by stale cache. */
6466
QML_DISABLE_DISK_CACHE = "true"
6567
/* Control output the filename */
66-
VERSION = sh(script: "./scripts/version.sh", returnStdout: true).trim()
68+
VERSION = "${sh(script: 'git describe --tags', returnStdout: true).trim()}"
6769
STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'nix.AppImage', arch: getArch(), version: env.VERSION)}"
6870
STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'nix.tar.gz', arch: getArch(), version: env.VERSION)}"
6971
/* prevent sharing cache dir across different jobs */
@@ -81,6 +83,26 @@ pipeline {
8183
}
8284

8385
stages {
86+
stage('Checkout') {
87+
steps {
88+
checkout([
89+
$class: 'GitSCM',
90+
branches: scm.branches,
91+
doGenerateSubmoduleConfigurations: false,
92+
extensions: [
93+
[$class: 'SubmoduleOption',
94+
disableSubmodules: false,
95+
parentCredentials: true,
96+
recursiveSubmodules: false,
97+
reference: '',
98+
trackingSubmodules: false
99+
]
100+
],
101+
submoduleCfg: [],
102+
userRemoteConfigs: scm.userRemoteConfigs
103+
])
104+
}
105+
}
84106
stage('Cleanup Workspace') {
85107
steps {
86108
sh './scripts/clean-git.sh'

ci/Jenkinsfile.macos

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ pipeline {
4949
}
5050

5151
options {
52+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
53+
skipDefaultCheckout()
5254
timestamps()
5355
/* Prevent Jenkins jobs from running forever */
5456
timeout(time: 30, unit: 'MINUTES')
@@ -81,7 +83,7 @@ pipeline {
8183
/* Avoid weird bugs caused by stale cache. */
8284
QML_DISABLE_DISK_CACHE = "true"
8385
/* Control output the filename */
84-
VERSION = sh(script: "./scripts/version.sh", returnStdout: true).trim()
86+
VERSION = "${sh(script: 'git describe --tags', returnStdout: true).trim()}${params.USE_NWAKU ? '-nwaku-experimental' : ''}"
8587
STATUS_CLIENT_DMG = "pkg/${utils.pkgFilename(ext: 'dmg', arch: getArch(), version: env.VERSION)}"
8688
/* Apple Team ID for Notarization */
8789
MACOS_NOTARIZE_TEAM_ID = "8B5X2M6H2Y"
@@ -101,6 +103,26 @@ pipeline {
101103
}
102104

103105
stages {
106+
stage('Checkout') {
107+
steps {
108+
checkout([
109+
$class: 'GitSCM',
110+
branches: scm.branches,
111+
doGenerateSubmoduleConfigurations: false,
112+
extensions: [
113+
[$class: 'SubmoduleOption',
114+
disableSubmodules: false,
115+
parentCredentials: true,
116+
recursiveSubmodules: false,
117+
reference: '',
118+
trackingSubmodules: false
119+
]
120+
],
121+
submoduleCfg: [],
122+
userRemoteConfigs: scm.userRemoteConfigs
123+
])
124+
}
125+
}
104126
stage('Cleanup Workspace') {
105127
steps {
106128
sh './scripts/clean-git.sh'

ci/Jenkinsfile.qt-build

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ pipeline {
77
}
88

99
options {
10+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
11+
skipDefaultCheckout()
1012
buildDiscarder(logRotator(numToKeepStr: '20'))
1113
timestamps()
1214
timeout(time: 12, unit: 'HOURS')
@@ -87,7 +89,26 @@ pipeline {
8789
}
8890

8991
stages {
90-
92+
stage('Checkout') {
93+
steps {
94+
checkout([
95+
$class: 'GitSCM',
96+
branches: scm.branches,
97+
doGenerateSubmoduleConfigurations: false,
98+
extensions: [
99+
[$class: 'SubmoduleOption',
100+
disableSubmodules: false,
101+
parentCredentials: true,
102+
recursiveSubmodules: false,
103+
reference: '',
104+
trackingSubmodules: false
105+
]
106+
],
107+
submoduleCfg: [],
108+
userRemoteConfigs: scm.userRemoteConfigs
109+
])
110+
}
111+
}
91112
stage('Build Docker Image for Linux') {
92113
steps {
93114
script {

ci/Jenkinsfile.tests-e2e

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ pipeline {
4848
}
4949

5050
options {
51+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
52+
skipDefaultCheckout()
5153
timestamps()
5254
/* Prevent Jenkins jobs from running forever */
5355
timeout(time: 120, unit: 'MINUTES')
@@ -103,6 +105,26 @@ pipeline {
103105
}
104106

105107
stages {
108+
stage('Checkout') {
109+
steps {
110+
checkout([
111+
$class: 'GitSCM',
112+
branches: scm.branches,
113+
doGenerateSubmoduleConfigurations: false,
114+
extensions: [
115+
[$class: 'SubmoduleOption',
116+
disableSubmodules: false,
117+
parentCredentials: true,
118+
recursiveSubmodules: false,
119+
reference: '',
120+
trackingSubmodules: false
121+
]
122+
],
123+
submoduleCfg: [],
124+
userRemoteConfigs: scm.userRemoteConfigs
125+
])
126+
}
127+
}
106128
stage('Cleanup Workspace') {
107129
steps {
108130
sh './scripts/clean-git.sh'

ci/Jenkinsfile.tests-nim

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ pipeline {
2626
}
2727

2828
options {
29+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
30+
skipDefaultCheckout()
2931
timestamps()
3032
/* Prevent Jenkins jobs from running forever */
3133
timeout(time: 20, unit: 'MINUTES')
@@ -60,6 +62,26 @@ pipeline {
6062
}
6163

6264
stages {
65+
stage('Checkout') {
66+
steps {
67+
checkout([
68+
$class: 'GitSCM',
69+
branches: scm.branches,
70+
doGenerateSubmoduleConfigurations: false,
71+
extensions: [
72+
[$class: 'SubmoduleOption',
73+
disableSubmodules: false,
74+
parentCredentials: true,
75+
recursiveSubmodules: false,
76+
reference: '',
77+
trackingSubmodules: false
78+
]
79+
],
80+
submoduleCfg: [],
81+
userRemoteConfigs: scm.userRemoteConfigs
82+
])
83+
}
84+
}
6385
stage('Cleanup Workspace') {
6486
steps {
6587
sh './scripts/clean-git.sh'

ci/Jenkinsfile.tests-ui

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pipeline {
1818
}
1919

2020
options {
21+
/* IMPORTANT: Disable automatic checkout to control submodule handling */
22+
skipDefaultCheckout()
2123
timestamps()
2224
/* Prevent Jenkins jobs from running forever */
2325
timeout(time: 120, unit: 'MINUTES')
@@ -46,6 +48,26 @@ pipeline {
4648
}
4749

4850
stages {
51+
stage('Checkout') {
52+
steps {
53+
checkout([
54+
$class: 'GitSCM',
55+
branches: scm.branches,
56+
doGenerateSubmoduleConfigurations: false,
57+
extensions: [
58+
[$class: 'SubmoduleOption',
59+
disableSubmodules: false,
60+
parentCredentials: true,
61+
recursiveSubmodules: false,
62+
reference: '',
63+
trackingSubmodules: false
64+
]
65+
],
66+
submoduleCfg: [],
67+
userRemoteConfigs: scm.userRemoteConfigs
68+
])
69+
}
70+
}
4971
stage('Cleanup Workspace') {
5072
steps {
5173
sh './scripts/clean-git.sh'

0 commit comments

Comments
 (0)