Skip to content
Snippets Groups Projects
Commit d69ed30d authored by Lars Bilke's avatar Lars Bilke Committed by GitHub
Browse files

Merge pull request #1396 from bilke/s3upload-notest

Upload binaries to S3
parents 84f9db9b 755d28c7
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,10 @@ node('master') { ...@@ -13,6 +13,10 @@ node('master') {
parallel builders parallel builders
step([$class: 'GitHubCommitStatusSetter']) step([$class: 'GitHubCommitStatusSetter'])
if (env.BRANCH_NAME == 'master') {
build job: 'OGS-6/Deploy', wait: false
}
} }
properties ([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '25']]]) properties ([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '25']]])
defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache' defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache'
node('docker') node('docker') {
{
stage 'Checkout' stage 'Checkout'
dir('ogs') { checkout scm } dir('ogs') { checkout scm }
// Multiple configurations are build in parallel // Multiple configurations are build in parallel
parallel linux: { parallel linux: {
docker.image('ogs6/clang-base:latest') docker.image('ogs6/clang-base:latest').inside(defaultDockerArgs) {
.inside(defaultDockerArgs)
{
catchError { catchError {
build 'build', '-DOGS_ADDRESS_SANITIZER=ON -DOGS_UNDEFINED_BEHAVIOR_SANITIZER=ON', '' build 'build', '-DOGS_ADDRESS_SANITIZER=ON ' +
'-DOGS_UNDEFINED_BEHAVIOR_SANITIZER=ON', ''
stage 'Unit tests' stage 'Unit tests'
sh '''cd build sh '''cd build
...@@ -43,4 +41,5 @@ def build(buildDir, cmakeOptions, target) { ...@@ -43,4 +41,5 @@ def build(buildDir, cmakeOptions, target) {
sh "cd ${buildDir} && make -j \$(nproc) ${target}" sh "cd ${buildDir} && make -j \$(nproc) ${target}"
} }
properties ([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '25']]]) properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator',
artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '25']]])
defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache' defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache'
defaultCMakeOptions = '-DOGS_LIB_BOOST=System -DOGS_LIB_VTK=System' defaultCMakeOptions = '-DOGS_LIB_BOOST=System -DOGS_LIB_VTK=System'
node('docker') node('docker') {
{
stage 'Checkout' stage 'Checkout'
checkout scm checkout scm
stage 'Build' stage 'Build'
docker.image('ogs6/gcc-base:latest') docker.image('ogs6/gcc-base:latest').inside(defaultDockerArgs) {
.inside(defaultDockerArgs) { build 'build', '-DOGS_COVERAGE=ON',
build 'build', '-DOGS_COVERAGE=ON', 'testrunner_coverage_cobertura ctest_coverage_cobertura'
'testrunner_coverage_cobertura ctest_coverage_cobertura' }
}
archive 'build/*.xml' archive 'build/*.xml'
// Report is published in a free-style child job // Report is published in a free-style child job
...@@ -27,4 +25,5 @@ def build(buildDir, cmakeOptions, target) { ...@@ -27,4 +25,5 @@ def build(buildDir, cmakeOptions, target) {
sh "cd ${buildDir} && make -j \$(nproc) ${target}" sh "cd ${buildDir} && make -j \$(nproc) ${target}"
} }
properties ([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '1', daysToKeepStr: '', numToKeepStr: '5']]]) properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator',
artifactDaysToKeepStr: '', artifactNumToKeepStr: '1', daysToKeepStr: '', numToKeepStr: '5']]])
#!/usr/bin/env groovy
node('master') {
stage 'Deploy S3 Info'
sh "curl 'https://svn.ufz.de:8443/job/OGS-6/job/Deploy/2/api/json?pretty=true&tree=actions" +
"[artifacts[*]],url' -g --insecure -o lastSuccessfulArtifacts.json"
archive 'lastSuccessfulArtifacts.json'
step([$class: 'S3BucketPublisher', dontWaitForConcurrentBuildCompletion: true, entries:
[[bucket: 'opengeosys', excludedFile: '', flatten: true, gzipFiles: false,
managedArtifacts: false, noUploadOnFailure: true, selectedRegion: 'eu-central-1',
sourceFile: "lastSuccessfulArtifacts.json", storageClass: 'STANDARD',
uploadFromSlave: true, useServerSideEncryption: false]], profileName: 'S3 UFZ',
userMetadata: [[key:
'Content-Type', value: 'Application/json']]])
}
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator',
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '5',
daysToKeepStr: '', numToKeepStr: '10']]])
#!/usr/bin/env groovy
node('master') {
stage 'Deploy to S3'
step([$class: 'CopyArtifact', fingerprintArtifacts: true, flatten: true,
projectName: 'OGS-6/ufz/master'])
s3upload('*')
build job: 'OGS-6/Deploy-Post', wait: false
}
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator',
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '5',
daysToKeepStr: '',
numToKeepStr: '10']]])
def s3upload(files) {
step([$class: 'S3BucketPublisher',
dontWaitForConcurrentBuildCompletion: true, entries:
[[bucket: 'opengeosys', excludedFile: '', flatten: true, gzipFiles: false,
managedArtifacts: true, noUploadOnFailure: true, selectedRegion: 'eu-central-1',
sourceFile: "${files}", storageClass: 'STANDARD', uploadFromSlave: true,
useServerSideEncryption: false]], profileName: 'S3 UFZ', userMetadata: []])
}
defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache' defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache'
defaultCMakeOptions = '-DOGS_LIB_BOOST=System -DOGS_LIB_VTK=System' defaultCMakeOptions = '-DOGS_LIB_BOOST=System -DOGS_LIB_VTK=System'
node('docker') node('docker') {
{
stage 'Checkout (Linux-Docker)' stage 'Checkout (Linux-Docker)'
dir('ogs') { checkout scm } dir('ogs') { checkout scm }
docker.image('ogs6/gcc-base:latest').inside(defaultDockerArgs) docker.image('ogs6/gcc-base:latest').inside(defaultDockerArgs) {
{
stage 'Configure (Linux-Docker)' stage 'Configure (Linux-Docker)'
configure 'build', '' configure 'build', ''
...@@ -17,13 +15,13 @@ node('docker') ...@@ -17,13 +15,13 @@ node('docker')
stage 'Test (Linux-Docker)' stage 'Test (Linux-Docker)'
build 'build', 'tests ctest' build 'build', 'tests ctest'
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.contains('release') ) { if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.contains('release')) {
stage 'Release (Linux-Docker)' stage 'Release (Linux-Docker)'
build 'build', 'package' build 'build', 'package'
} }
} }
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.contains('release') ) { if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.contains('release')) {
archive 'build/*.tar.gz' archive 'build/*.tar.gz'
} }
...@@ -45,14 +43,18 @@ def build(buildDir, target) { ...@@ -45,14 +43,18 @@ def build(buildDir, target) {
def publishTestReports(ctestPattern, gtestPattern, parseRulefile) { def publishTestReports(ctestPattern, gtestPattern, parseRulefile) {
step([$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1, step([$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1,
thresholds: [ thresholds: [
[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''], [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '',
[$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']], unstableNewThreshold: '', unstableThreshold: ''],
[$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '',
unstableNewThreshold: '', unstableThreshold: '']],
tools: [ tools: [
[$class: 'CTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: "${ctestPattern}", skipNoTestFiles: false, stopProcessingIfError: true], [$class: 'CTestType', deleteOutputFiles: true, failIfNotNew: true, pattern:
[$class: 'GoogleTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: "${gtestPattern}", skipNoTestFiles: false, stopProcessingIfError: true]] "${ctestPattern}", skipNoTestFiles: false, stopProcessingIfError: true],
[$class: 'GoogleTestType', deleteOutputFiles: true, failIfNotNew: true, pattern:
"${gtestPattern}", skipNoTestFiles: false, stopProcessingIfError: true]]
]) ])
step([$class: 'LogParserPublisher', failBuildOnError: true, unstableOnWarning: false, step([$class: 'LogParserPublisher', failBuildOnError: true, unstableOnWarning: false,
projectRulePath: "${parseRulefile}", useProjectRule: true]) projectRulePath: "${parseRulefile}", useProjectRule: true])
} }
// *** End helper functions *** // *** End helper functions ***
defaultCMakeOptions = '-DCMAKE_BUILD_TYPE=Release -DOGS_LIB_BOOST=System -DOGS_LIB_VTK=System -DOGS_DOWNLOAD_ADDITIONAL_CONTENT=ON' defaultCMakeOptions = '-DCMAKE_BUILD_TYPE=Release -DOGS_LIB_BOOST=System -DOGS_LIB_VTK=System ' +
'-DOGS_DOWNLOAD_ADDITIONAL_CONTENT=ON'
node('win && conan') node('win && conan') {
{
stage 'Checkout (Win)' stage 'Checkout (Win)'
dir('ogs') { checkout scm } dir('ogs') { checkout scm }
withEnv(getEnv()) { withEnv(getEnv()) {
stage 'Configure (Win)' stage 'Configure (Win)'
configure 'build', '', 'Ninja', configure 'build', '', 'Ninja',
'-u -s build_type=Release -s compiler="Visual Studio" -s compiler.version=12 -s arch=x86_64' '-u -s build_type=Release -s compiler="Visual Studio" -s compiler.version=12 -s ' +
'arch=x86_64'
stage 'CLI (Win)' stage 'CLI (Win)'
build 'build', 'package' build 'build', 'package'
...@@ -18,12 +19,13 @@ node('win && conan') ...@@ -18,12 +19,13 @@ node('win && conan')
stage 'Data Explorer (Win)' stage 'Data Explorer (Win)'
configure 'build', '-DOGS_BUILD_GUI=ON -DOGS_BUILD_UTILS=ON -DOGS_BUILD_TESTS=OFF', configure 'build', '-DOGS_BUILD_GUI=ON -DOGS_BUILD_UTILS=ON -DOGS_BUILD_TESTS=OFF',
'Ninja', '-u -s build_type=Release -s compiler="Visual Studio" -s compiler.version=12 -s arch=x86_64', 'Ninja', '-u -s build_type=Release -s compiler="Visual Studio" -s compiler.version=12' +
' -s arch=x86_64',
true true
build 'build', 'package' build 'build', 'package'
} }
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.contains('release') ) { if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.contains('release')) {
stage 'Release (Win)' stage 'Release (Win)'
archive 'build/*.zip' archive 'build/*.zip'
} }
...@@ -34,8 +36,7 @@ node('win && conan') ...@@ -34,8 +36,7 @@ node('win && conan')
} }
// *** Helper functions *** // *** Helper functions ***
def getEnv() def getEnv() {
{
if (env.NODE_NAME == 'visserv3') if (env.NODE_NAME == 'visserv3')
qtdir = 'C:\\libs\\qt\\4.8\\msvc2013-x64' qtdir = 'C:\\libs\\qt\\4.8\\msvc2013-x64'
if (env.NODE_NAME == 'win1') if (env.NODE_NAME == 'win1')
...@@ -49,7 +50,7 @@ def getEnv() ...@@ -49,7 +50,7 @@ def getEnv()
} }
def configure(buildDir, cmakeOptions, generator, conan_args=null, keepBuildDir=false) { def configure(buildDir, cmakeOptions, generator, conan_args = null, keepBuildDir = false) {
if (keepBuildDir == false) if (keepBuildDir == false)
bat("""rd /S /Q ${buildDir} bat("""rd /S /Q ${buildDir}
mkdir ${buildDir}""".stripIndent()) mkdir ${buildDir}""".stripIndent())
...@@ -62,7 +63,7 @@ def configure(buildDir, cmakeOptions, generator, conan_args=null, keepBuildDir=f ...@@ -62,7 +63,7 @@ def configure(buildDir, cmakeOptions, generator, conan_args=null, keepBuildDir=f
cmake ../ogs -G "${generator}" ${defaultCMakeOptions} ${cmakeOptions}""" cmake ../ogs -G "${generator}" ${defaultCMakeOptions} ${cmakeOptions}"""
} }
def build(buildDir, target=null) { def build(buildDir, target = null) {
targetString = "" targetString = ""
if (target != null) if (target != null)
targetString = "--target ${target}" targetString = "--target ${target}"
...@@ -72,20 +73,19 @@ def build(buildDir, target=null) { ...@@ -72,20 +73,19 @@ def build(buildDir, target=null) {
cmake --build . --config Release ${targetString}""".stripIndent()) cmake --build . --config Release ${targetString}""".stripIndent())
} }
def deploy(files) {
step([$class: 'S3BucketPublisher', dontWaitForConcurrentBuildCompletion: true, entries: [[bucket: 'opengeosys', excludedFile: '', flatten: true, gzipFiles: false, managedArtifacts: true, noUploadOnFailure: true, selectedRegion: 'eu-central-1', sourceFile: "${files}", storageClass: 'STANDARD', uploadFromSlave: true, useServerSideEncryption: false]], profileName: 'S3 UFZ', userMetadata: []])
}
def publishTestReports(ctestPattern, gtestPattern, parseRulefile) { def publishTestReports(ctestPattern, gtestPattern, parseRulefile) {
step([$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1, step([$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1,
thresholds: [ thresholds: [
[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''], [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '',
[$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']], unstableNewThreshold: '', unstableThreshold: ''],
[$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '',
unstableNewThreshold: '', unstableThreshold: '']],
tools: [ tools: [
[$class: 'GoogleTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: "${gtestPattern}", skipNoTestFiles: false, stopProcessingIfError: true]] [$class: 'GoogleTestType', deleteOutputFiles: true, failIfNotNew: true, pattern:
"${gtestPattern}", skipNoTestFiles: false, stopProcessingIfError: true]]
]) ])
step([$class: 'LogParserPublisher', failBuildOnError: true, unstableOnWarning: false, step([$class: 'LogParserPublisher', failBuildOnError: true, unstableOnWarning: false,
projectRulePath: "${parseRulefile}", useProjectRule: true]) projectRulePath: "${parseRulefile}", useProjectRule: true])
} }
// *** End helper functions *** // *** End helper functions ***
defaultCMakeOptions = '-DCMAKE_BUILD_TYPE=Release -DOGS_32_BIT=ON -DOGS_LIB_BOOST=System -DOGS_LIB_VTK=System -DOGS_DOWNLOAD_ADDITIONAL_CONTENT=ON' defaultCMakeOptions = '-DCMAKE_BUILD_TYPE=Release -DOGS_32_BIT=ON -DOGS_LIB_BOOST=System ' +
'-DOGS_LIB_VTK=System -DOGS_DOWNLOAD_ADDITIONAL_CONTENT=ON'
node('win && conan') node('win && conan') {
{
stage 'Checkout (Win)' stage 'Checkout (Win)'
dir('ogs') { checkout scm } dir('ogs') { checkout scm }
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.contains('release') ) { if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.contains('release')) {
stage 'Data Explorer 32-bit (Win)' stage 'Data Explorer 32-bit (Win)'
withEnv(getEnv()) { withEnv(getEnv()) {
configure 'build-32', '-DOGS_BUILD_GUI=ON -DOGS_BUILD_UTILS=ON -DOGS_BUILD_TESTS=OFF', 'Ninja', '-u -s build_type=Release -s compiler="Visual Studio" -s compiler.version=12 -s arch=x86' configure 'build-32', '-DOGS_BUILD_GUI=ON -DOGS_BUILD_UTILS=ON ' +
'-DOGS_BUILD_TESTS=OFF', 'Ninja', '-u -s build_type=Release -s compiler="Visual ' +
'Studio" -s compiler.version=12 -s arch=x86'
build 'build-32', 'package' build 'build-32', 'package'
} }
archive 'build-32/*.zip' archive 'build-32/*.zip'
} }
} }
def getEnv() def getEnv() {
{
if (env.NODE_NAME == 'visserv3') if (env.NODE_NAME == 'visserv3')
qtdir = 'C:\\libs\\qt\\4.8\\msvc2013-x32' qtdir = 'C:\\libs\\qt\\4.8\\msvc2013-x32'
if (env.NODE_NAME == 'win1') if (env.NODE_NAME == 'win1')
...@@ -29,21 +30,20 @@ def getEnv() ...@@ -29,21 +30,20 @@ def getEnv()
] ]
} }
def configure(buildDir, cmakeOptions, generator, conan_args=null) { def configure(buildDir, cmakeOptions, generator, conan_args = null) {
bat("""rd /S /Q ${buildDir} bat("""rd /S /Q ${buildDir}
mkdir ${buildDir}""".stripIndent()) mkdir ${buildDir}""".stripIndent())
if (conan_args != null) if (conan_args != null)
bat("""cd ${buildDir} bat("""cd ${buildDir}
conan install ../ogs ${conan_args}""".stripIndent()) conan install ../ogs ${conan_args}""".stripIndent())
if (generator == 'Ninja') if (generator == 'Ninja')
bat """set path=%path:\"=%
bat """set path=%path:\"=%
call "%vs120comntools%..\\..\\VC\\vcvarsall.bat" x86 call "%vs120comntools%..\\..\\VC\\vcvarsall.bat" x86
cd ${buildDir} cd ${buildDir}
cmake ../ogs -G "${generator}" ${defaultCMakeOptions} ${cmakeOptions}""" cmake ../ogs -G "${generator}" ${defaultCMakeOptions} ${cmakeOptions}"""
} }
def build(buildDir, target=null) { def build(buildDir, target = null) {
targetString = "" targetString = ""
if (target != null) if (target != null)
targetString = "--target ${target}" targetString = "--target ${target}"
...@@ -52,9 +52,4 @@ def build(buildDir, target=null) { ...@@ -52,9 +52,4 @@ def build(buildDir, target=null) {
cd ${buildDir} cd ${buildDir}
cmake --build . --config Release ${targetString}""".stripIndent()) cmake --build . --config Release ${targetString}""".stripIndent())
} }
def deploy(files) {
// archive "${files}"
step([$class: 'S3BucketPublisher', dontWaitForConcurrentBuildCompletion: true, entries: [[bucket: 'opengeosys', excludedFile: '', flatten: true, gzipFiles: false, managedArtifacts: true, noUploadOnFailure: true, selectedRegion: 'eu-central-1', sourceFile: "${files}", storageClass: 'STANDARD', uploadFromSlave: true, useServerSideEncryption: false]], profileName: 'S3 UFZ', userMetadata: []])
}
// *** End helper functions *** // *** End helper functions ***
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment