Files
my-rook-config/Jenkinsfile
T
Bassam Tabbara 59f5815115 build: support for promoting a build
support for build promotion. For example, make promote CHANNEL=alpha VERISON=v0.4.0, will push the v0.4.0 bits to the alpha channel.
2017-04-04 17:02:25 -07:00

57 lines
1.7 KiB
Groovy

// Rook build for Jenkins Pipelines
try {
node("ec2-stateful") {
stage('Checkout') {
checkout scm
sh 'git submodule sync --recursive'
sh 'git submodule update --init --recursive'
}
stage('Validation') {
sh 'external/ceph-submodule-check'
}
withEnv(["DOWNLOADDIR=${env.HOME}/.download", "ALWAYS_BUILD=0", "CHANNEL=${env.BRANCH_NAME}"]) {
stage('Build') {
sh 'build/run make -j\$(nproc) release'
}
stage('Tests') {
sh 'build/run make -j\$(nproc) check'
}
stage('Publish') {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: 'rook-quay-io', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASSWORD'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: 'rook-jenkins-aws', usernameVariable: 'AWS_ACCESS_KEY_ID', passwordVariable: 'AWS_SECRET_ACCESS_KEY'],
[$class: 'StringBinding', credentialsId: 'quantumbuild-token', variable: 'GITHUB_TOKEN']
]) {
sh 'docker login -u="${DOCKER_USER}" -p="${DOCKER_PASSWORD}" quay.io'
sh 'build/run make -j\$(nproc) publish'
}
}
stage('Cleanup') {
sh 'build/run make -j\$(nproc) publish.cleanup'
sh 'docker images'
deleteDir()
}
}
}
}
catch (Exception e) {
echo 'Failure encountered'
node("ec2-stateful") {
echo 'Cleaning up workspace'
sh 'build/run make -j\$(nproc) publish.cleanup'
sh 'docker images'
deleteDir()
}
exit 1
}