Skip to content

Commit b82c5b7

Browse files
AnHeuermannlochel
andauthored
Archive artifacts to build.openmodelica.org (#857)
* Archive artifacts to build.openmodelica.org * Fix typo Co-authored-by: Lennart Ochel <lennart.ochel@liu.se>
1 parent 84ce3df commit b82c5b7

File tree

1 file changed

+92
-11
lines changed

1 file changed

+92
-11
lines changed

Jenkinsfile

Lines changed: 92 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pipeline {
1010
booleanParam(name: 'MSVC64', defaultValue: true, description: 'Build with MSVC64 (often hangs)')
1111
booleanParam(name: 'MINGW32', defaultValue: false, description: 'Build with MINGW32 (does not link boost)')
1212
booleanParam(name: 'SUBMODULE_UPDATE', defaultValue: false, description: 'Allow pull request to update submodules (disabled by default due to common user errors)')
13+
booleanParam(name: 'UPLOAD_BUILD_OPENMODELICA', defaultValue: false, description: 'Upload install artifacts to build.openmodelica.org/omsimulator')
1314
string(name: 'RUNTESTS_FLAG', defaultValue: '', description: 'runtests.pl flag')
1415
}
1516
stages {
@@ -65,6 +66,7 @@ pipeline {
6566
sh 'make doc doc-html doc-doxygen'
6667
sh '(cd install/linux/doc && zip -r "../../../OMSimulator-doc-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *)'
6768
archiveArtifacts artifacts: 'OMSimulator-doc*.zip,OMSimulator-linux-amd64-*.tar.gz', fingerprint: true
69+
stash name: 'amd64-zip', includes: "OMSimulator-linux-amd64-*.tar.gz"
6870
stash name: 'docs', includes: "install/linux/doc/**"
6971
}
7072
}
@@ -193,6 +195,7 @@ pipeline {
193195
'''
194196

195197
archiveArtifacts "OMSimulator-linux-i386-*.tar.gz"
198+
stash name: 'i389-zip', includes: "OMSimulator-linux-i386-*.tar.gz"
196199

197200
partest()
198201

@@ -230,6 +233,7 @@ pipeline {
230233
'''
231234

232235
archiveArtifacts "OMSimulator-linux-arm32-*.tar.gz"
236+
stash name: 'arm32-zip', includes: "OMSimulator-linux-arm32-*.tar.gz"
233237
stash name: 'arm32-install', includes: "install/linux/**"
234238
}
235239
}
@@ -299,7 +303,8 @@ pipeline {
299303
(cd install/mac && zip -r "../../OMSimulator-osx-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *)
300304
'''
301305

302-
archiveArtifacts "OMSimulator-osx*.zip"
306+
archiveArtifacts "OMSimulator-osx-*.zip"
307+
stash name: 'osx-zip', includes: "OMSimulator-osx-*.zip"
303308
stash name: 'osx-install', includes: "install/mac/**"
304309
}
305310
}
@@ -349,7 +354,8 @@ pipeline {
349354
(cd install/mingw && zip -r "../../OMSimulator-mingw64-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *)
350355
'''
351356

352-
archiveArtifacts "OMSimulator-mingw64*.zip"
357+
archiveArtifacts "OMSimulator-mingw64-*.zip"
358+
stash name: 'mingw64-zip', includes: "OMSimulator-mingw64-*.zip"
353359
stash name: 'mingw64-install', includes: "install/mingw/**"
354360
}
355361
}
@@ -385,7 +391,8 @@ pipeline {
385391
(cd install/mingw && zip -r "../../OMSimulator-mingw32-`git describe --tags --abbrev=7 --match=v*.* --exclude=*-dev | sed \'s/-/.post/\'`.zip" *)
386392
'''
387393

388-
archiveArtifacts "OMSimulator-mingw32*.zip"
394+
archiveArtifacts "OMSimulator-mingw32-*.zip"
395+
stash name: 'mingw32-zip', includes: "OMSimulator-mingw32-*.zip"
389396
stash name: 'mingw32-install', includes: "install/mingw/**"
390397
}
391398
}
@@ -435,7 +442,8 @@ ECHO Something went wrong!
435442
EXIT /b 1
436443
""" }
437444

438-
archiveArtifacts "OMSimulator-win64*.zip"
445+
archiveArtifacts "OMSimulator-win64-*.zip"
446+
stash name: 'win64-zip', includes: "OMSimulator-win64-*.zip"
439447
}
440448
}
441449

@@ -465,17 +473,90 @@ EXIT /b 1
465473
agent {
466474
label 'linux'
467475
}
468-
/*
469-
// Does not pass GIT_BRANCH env.var
470-
options {
471-
skipDefaultCheckout()
472-
}
473-
*/
474476
steps {
475477
unstash name: 'docs'
476478
sh "test ! -z '${env.GIT_BRANCH}'"
477479
sh "test ! '${env.GIT_BRANCH}' = 'null'"
478-
sshPublisher(publishers: [sshPublisherDesc(configName: 'OMSimulator-doc', transfers: [sshTransfer(execCommand: "rm -rf .tmp/${env.GIT_BRANCH}"), sshTransfer(execCommand: "test ! -z '${env.GIT_BRANCH}' && rm -rf '/var/www/doc/OMSimulator/${env.GIT_BRANCH}' && mkdir -p `dirname '/var/www/doc/OMSimulator/.tmp/${env.GIT_BRANCH}'` && mv '/var/www/doc/OMSimulator/.tmp/${env.GIT_BRANCH}' '/var/www/doc/OMSimulator/${env.GIT_BRANCH}'", remoteDirectory: ".tmp/${env.GIT_BRANCH}", removePrefix: "install/linux/doc", sourceFiles: 'install/linux/doc/**')])])
480+
sshPublisher (
481+
publishers: [
482+
sshPublisherDesc(
483+
configName: 'OMSimulator-doc',
484+
transfers: [
485+
sshTransfer(execCommand: "rm -rf .tmp/${env.GIT_BRANCH}"),
486+
sshTransfer(
487+
execCommand: "test ! -z '${env.GIT_BRANCH}' && rm -rf '/var/www/doc/OMSimulator/${env.GIT_BRANCH}' && mkdir -p `dirname '/var/www/doc/OMSimulator/.tmp/${env.GIT_BRANCH}'` && mv '/var/www/doc/OMSimulator/.tmp/${env.GIT_BRANCH}' '/var/www/doc/OMSimulator/${env.GIT_BRANCH}'",
488+
remoteDirectory: ".tmp/${env.GIT_BRANCH}",
489+
removePrefix: "install/linux/doc",
490+
sourceFiles: 'install/linux/doc/**')
491+
]
492+
)
493+
]
494+
)
495+
}
496+
}
497+
498+
stage('upload-artifacts') {
499+
when {
500+
allOf {
501+
not {
502+
changeRequest()
503+
}
504+
anyOf {
505+
buildingTag()
506+
anyOf {
507+
branch 'master'
508+
branch 'maintenance/**'
509+
}
510+
}
511+
expression { return params.MINGW32 }
512+
expression { return params.UPLOAD_BUILD_OPENMODELICA }
513+
}
514+
beforeAgent true
515+
}
516+
agent {
517+
label 'linux'
518+
}
519+
steps {
520+
unstash name: 'amd64-zip' // includes: "OMSimulator-linux-amd64-*.tar.gz"
521+
unstash name: 'arm32-zip' // includes: "OMSimulator-linux-arm32-*.tar.gz"
522+
unstash name: 'i389-zip' // includes: "OMSimulator-linux-i386-*.tar.gz"
523+
unstash name: 'mingw32-zip' // includes: "OMSimulator-mingw32-*.zip"
524+
unstash name: 'mingw64-zip' // includes: "OMSimulator-mingw64-*.zip"
525+
unstash name: 'win64-zip' // includes: "OMSimulator-win64-*.zip"
526+
unstash name: 'osx-zip' // includes: "OMSimulator-osx-*.zip"
527+
528+
sh "ls *.zip *.tar.gz"
529+
530+
sshPublisher (
531+
publishers: [
532+
sshPublisherDesc(
533+
configName: 'OMSimulator',
534+
transfers: [
535+
sshTransfer(
536+
remoteDirectory: "linux-i386/",
537+
sourceFiles: 'OMSimulator-linux-i386-*.tar.gz'),
538+
sshTransfer(
539+
remoteDirectory: "linux-arm32/",
540+
sourceFiles: 'OMSimulator-linux-arm32-*.tar.gz'),
541+
sshTransfer(
542+
remoteDirectory: "linux-amd64/",
543+
sourceFiles: 'OMSimulator-linux-amd64-*.tar.gz'),
544+
sshTransfer(
545+
remoteDirectory: "win-mingw32/",
546+
sourceFiles: 'OMSimulator-mingw32-*.zip'),
547+
sshTransfer(
548+
remoteDirectory: "win-mingw64/",
549+
sourceFiles: 'OMSimulator-mingw64-*.zip'),
550+
sshTransfer(
551+
remoteDirectory: "osx/",
552+
sourceFiles: 'OMSimulator-osx-*.zip'),
553+
sshTransfer(
554+
remoteDirectory: "win-msvc64/",
555+
sourceFiles: 'OMSimulator-win64-*.zip')
556+
]
557+
)
558+
]
559+
)
479560
}
480561
}
481562

0 commit comments

Comments
 (0)