parallel jenkins setup

This commit is contained in:
Stanislaw Kaushanski 2020-06-23 18:19:12 +02:00
parent 2552973c15
commit 744db33d41
1 changed files with 97 additions and 55 deletions

152
Jenkinsfile vendored
View File

@ -1,4 +1,4 @@
node { void checkout_hifive_vp() {
checkout([ checkout([
$class: 'GitSCM', $class: 'GitSCM',
branches: [[name: '*/develop']], branches: [[name: '*/develop']],
@ -23,60 +23,102 @@ node {
url: 'https://git.minres.com/VP/HIFIVE1-VP.git' url: 'https://git.minres.com/VP/HIFIVE1-VP.git'
]] ]]
]) ])
stage('build VP ubuntu/18.04'){ }
def ubuntu = docker.image('ubuntu-18.04')
ubuntu.inside('-u jenkins') { void build_hifive_vp() {
try { try {
sh("conan profile new default --detect --force") sh("conan profile new default --detect --force")
sh("conan profile update settings.compiler.libcxx=libstdc++11 default") sh("conan profile update settings.compiler.libcxx=libstdc++11 default")
sh("conan remote add minres https://api.bintray.com/conan/minres/conan-repo") sh("conan remote add minres https://api.bintray.com/conan/minres/conan-repo --force")
sh("conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan") sh("conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan --force")
} }
catch (exc) { catch (exc) {
echo 'Conan configured' echo 'Conan configured'
} }
sh("rm -rf HIFIVE1-VP/build-ubuntu") sh("rm -rf HIFIVE1-VP/build-ubuntu")
sh("mkdir -p HIFIVE1-VP/build-ubuntu") sh("mkdir -p HIFIVE1-VP/build-ubuntu")
sh("cd HIFIVE1-VP && git submodule update --recursive") sh("cd HIFIVE1-VP && git submodule update --recursive")
sh("cd HIFIVE1-VP/build-ubuntu && MAKE_FLAGS='-j4' cmake .. && make -j4") sh("cd HIFIVE1-VP/build-ubuntu && MAKE_FLAGS='-j4' cmake .. && make -j4")
fingerprint 'HIFIVE1-VP/build-ubuntu/bin/riscv.vp' fingerprint 'HIFIVE1-VP/build-ubuntu/bin/riscv.vp'
} }
void build_hifive_without_scv() {
try {
sh("conan profile new default --detect --force")
sh("conan profile update settings.compiler.libcxx=libstdc++11 default")
sh("conan remote add minres https://api.bintray.com/conan/minres/conan-repo")
sh("conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan")
}
catch (exc) {
echo 'Conan configured'
}
sh("rm -rf HIFIVE1-VP/build-ubuntu")
sh("mkdir -p HIFIVE1-VP/build-ubuntu")
sh("cd HIFIVE1-VP && git submodule update --recursive")
sh("cd HIFIVE1-VP/build-ubuntu && MAKE_FLAGS='-j4' cmake .. -DENABLE_SCV=FALSE && make -j4")
fingerprint 'HIFIVE1-VP/build-ubuntu/bin/riscv.vp'
}
pipeline {
agent none
options {
// using the Timestamper plugin we can add timestamps to the console log
timestamps()
skipStagesAfterUnstable()
} }
stage('build VP fedora/28'){
def centos = docker.image('fedora28') stages {
centos.inside('-u jenkins') { stage('HiFive-VP pipeline') {
try { parallel {
sh("conan profile new default --detect --force") stage('ubuntu/18.04'){
sh("conan profile update settings.compiler.libcxx=libstdc++11 default") agent {docker { image 'ubuntu-18.04' } }
sh("conan remote add minres https://api.bintray.com/conan/minres/conan-repo") stages {
sh("conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan") stage('Checkout on Ubuntu') {
} steps {
catch (exc) { checkout_hifive_vp()
echo 'Conan configured' }
} }
sh("rm -rf HIFIVE1-VP/build-fedora") stage('Build on Ubuntu') {
sh("mkdir HIFIVE1-VP/build-fedora") steps {
sh("cd HIFIVE1-VP/build-fedora && MAKE_FLAGS='-j4' cmake .. && make -j4") build_hifive_vp()
fingerprint 'HIFIVE1-VP/build-fedora/bin/riscv.vp' }
} }
} }
stage('build VP without SCV'){ }
def ubuntu = docker.image('ubuntu-18.04') stage('Fedora/28'){
ubuntu.inside('-u jenkins') { agent {docker { image 'fedora28' } }
try { stages {
sh("conan profile new default --detect --force") stage('Checkout on Fedora') {
sh("conan profile update settings.compiler.libcxx=libstdc++11 default") steps {
sh("conan remote add minres https://api.bintray.com/conan/minres/conan-repo") checkout_hifive_vp()
sh("conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan") }
} }
catch (exc) { stage('Build on Fedora') {
echo 'Conan configured' steps {
} build_hifive_vp()
sh("rm -rf HIFIVE1-VP/build-ubuntu") }
sh("mkdir -p HIFIVE1-VP/build-ubuntu") }
sh("cd HIFIVE1-VP && git submodule update --recursive") }
sh("cd HIFIVE1-VP/build-ubuntu && MAKE_FLAGS='-j4' cmake .. -DENABLE_SCV=FALSE && make -j4") }
fingerprint 'HIFIVE1-VP/build-ubuntu/bin/riscv.vp' stage('Build without SCV'){
} agent {docker { image 'ubuntu-18.04' } }
stages {
stage('Checkout on Ubuntu') {
steps {
checkout_hifive_vp()
}
}
stage('Build without SCV') {
steps {
build_hifive_without_scv()
}
}
}
}
}
}
} }
} }