@@ -4,7 +4,7 @@ def baseTests(String image) {
4
4
Map base_tests = [failFast : false ];
5
5
6
6
base_tests[' Unit Tests CTest' ] = {
7
- docker . image(image) . inside( ' --user= root --privileged -v /var/run/docker.sock:/var/run/docker.sock ' ) {
7
+ withDockerContainer( args : ' -u root' , image : image ) {
8
8
stage(' Setup CTest' ) {
9
9
echo ' Nothing to be done.' ;
10
10
}
@@ -27,7 +27,7 @@ def baseTests(String image) {
27
27
28
28
base_tests[' Unit Tests Tcl' ] = {
29
29
node {
30
- docker . image(image) . inside( ' --user= root --privileged -v /var/run/docker.sock:/var/run/docker.sock ' ) {
30
+ withDockerContainer( args : ' -u root' , image : image ) {
31
31
stage(' Setup Tcl Tests' ) {
32
32
sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
33
33
checkout scm;
@@ -68,7 +68,7 @@ def baseTests(String image) {
68
68
flow_tests. each { current_test ->
69
69
base_tests[" Flow Test - ${ current_test} " ] = {
70
70
node {
71
- docker . image(image) . inside( ' --user= root --privileged -v /var/run/docker.sock:/var/run/docker.sock ' ) {
71
+ withDockerContainer( args : ' -u root' , image : image ) {
72
72
stage(" Setup ${ current_test} " ) {
73
73
sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
74
74
checkout scm;
@@ -104,7 +104,7 @@ def getParallelTests(String image) {
104
104
105
105
' Build without GUI' : {
106
106
node {
107
- docker . image(image) . inside( ' --user= root --privileged -v /var/run/docker.sock:/var/run/docker.sock ' ) {
107
+ withDockerContainer( args : ' -u root' , image : image ) {
108
108
stage(' Setup no-GUI Build' ) {
109
109
echo " Build without GUI" ;
110
110
sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
@@ -121,7 +121,7 @@ def getParallelTests(String image) {
121
121
122
122
' Build without Test' : {
123
123
node {
124
- docker . image(image) . inside( ' --user= root --privileged -v /var/run/docker.sock:/var/run/docker.sock ' ) {
124
+ withDockerContainer( args : ' -u root' , image : image ) {
125
125
stage(' Setup no-test Build' ) {
126
126
echo " Build without Tests" ;
127
127
sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
@@ -148,7 +148,7 @@ def getParallelTests(String image) {
148
148
149
149
' Unit Tests Ninja' : {
150
150
node {
151
- docker . image(image) . inside( ' --user= root --privileged -v /var/run/docker.sock:/var/run/docker.sock ' ) {
151
+ withDockerContainer( args : ' -u root' , image : image ) {
152
152
stage(' Setup Ninja Tests' ) {
153
153
sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
154
154
checkout scm;
@@ -174,7 +174,7 @@ def getParallelTests(String image) {
174
174
175
175
' Compile with C++20' : {
176
176
node {
177
- docker . image(image) . inside( ' --user= root --privileged -v /var/run/docker.sock:/var/run/docker.sock ' ) {
177
+ withDockerContainer( args : ' -u root' , image : image ) {
178
178
stage(' Setup C++20 Compile' ) {
179
179
sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
180
180
checkout scm;
@@ -188,6 +188,41 @@ def getParallelTests(String image) {
188
188
189
189
];
190
190
191
+ deb_os = [
192
+ [name : ' Ubuntu 20.04' , image : ' openroad/ubuntu20.04-dev' ],
193
+ [name : ' Ubuntu 22.04' , image : ' openroad/ubuntu22.04-dev' ],
194
+ [name : ' Debian 11' , image : ' openroad/debian11-dev' ]
195
+ ];
196
+
197
+ deb_os. each { os ->
198
+ ret[" Build .deb - ${ os.name} " ] = {
199
+ node {
200
+ stage(' Setup and Build' ) {
201
+ sh label : ' Pull latest image' , script : " docker pull ${ os.image} :latest" ;
202
+ withDockerContainer(args : ' -u root' , image : " ${ os.image} " ) {
203
+ sh label : ' Configure git' , script : " git config --system --add safe.directory '*'" ;
204
+ checkout([
205
+ $class : ' GitSCM' ,
206
+ branches : [[name : scm. branches[0 ]. name]],
207
+ doGenerateSubmoduleConfigurations : false ,
208
+ extensions : [
209
+ [$class : ' CloneOption' , noTags : false ],
210
+ [$class : ' SubmoduleOption' , recursiveSubmodules : true ]
211
+ ],
212
+ submoduleCfg : [],
213
+ userRemoteConfigs : scm. userRemoteConfigs
214
+ ]);
215
+ def version = sh(script : ' git describe | sed s,^v,,' , returnStdout : true ). trim();
216
+ sh label : ' Create Changelog' , script : " ./debian/create-changelog.sh ${ version} " ;
217
+ sh label : ' Run debuild' , script : ' debuild --preserve-env --preserve-envvar=PATH -B -j$(nproc)' ;
218
+ sh label : ' Move generated files' , script : " ./debian/move-artifacts.sh ${ version} " ;
219
+ archiveArtifacts artifacts : ' *' + " ${ version} " + ' *' ;
220
+ }
221
+ }
222
+ }
223
+ }
224
+ }
225
+
191
226
return ret;
192
227
}
193
228
@@ -196,7 +231,26 @@ node {
196
231
checkout scm;
197
232
}
198
233
def DOCKER_IMAGE ;
199
- stage(' Build and Push Docker Image' ) {
234
+ stage(' Build, Test and Push Docker Image' ) {
235
+ Map build_docker_images = [failFast : false ];
236
+ test_os = [
237
+ [name : ' Ubuntu 20.04' , base : ' ubuntu:20.04' , image : ' ubuntu20.04' ],
238
+ [name : ' Ubuntu 22.04' , base : ' ubuntu:22.04' , image : ' ubuntu22.04' ],
239
+ [name : ' Ubuntu 24.04' , base : ' ubuntu:24.04' , image : ' ubuntu24.04' ],
240
+ [name : ' RockLinux 9' , base : ' rockylinux:9' , image : ' rocklinux9' ],
241
+ [name : ' Debian 11' , base : ' debian:11' , image : ' debian11' ]
242
+ ];
243
+ test_os. each { os ->
244
+ build_docker_images[" Test Installer - ${ os.name} " ] = {
245
+ node {
246
+ checkout scm;
247
+ sh label : ' Build Docker image' , script : " ./etc/DockerHelper.sh create -target=builder -os=${ os.image} " ;
248
+ sh label : ' Test Docker image' , script : " ./etc/DockerHelper.sh test -target=builder -os=${ os.image} " ;
249
+ dockerPush(" ${ os.image} " , ' openroad' );
250
+ }
251
+ }
252
+ }
253
+ parallel(build_docker_images);
200
254
DOCKER_IMAGE = dockerPush(' ubuntu22.04' , ' openroad' );
201
255
echo " Docker image is ${ DOCKER_IMAGE} " ;
202
256
}
0 commit comments