Skip to content

Commit

Permalink
[jenkins]: add buildimage-mlnx-all-pr build
Browse files Browse the repository at this point in the history
  • Loading branch information
lguohan committed Jun 1, 2019
1 parent 3cd16fd commit 0c94f61
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions jenkins/mellanox/buildimage-mlnx-all-pr/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
pipeline {
agent { node { label 'jenkins-workers' } }

stages {
stage('Prepare') {
steps {
step([$class: 'WsCleanup'])
checkout([$class: 'GitSCM',
branches: [[name: '${sha1}']],
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false]],
userRemoteConfigs: [[url: 'http://github.com/Azure/sonic-buildimage'],
refspec: '+refs/pull/*:refs/remotes/origin/pr/*']]])

copyArtifacts(projectName: 'common/dep-build', filter: 'target/debs/stretch/*.deb', target: 'target/debs/stretch/*.deb', flatten: false)
}
}

stage('Build') {
steps {
sh '''
#!/bin/bash -xe
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
make configure PLATFORM=mellanox
touch target/debs/stretch/*.deb
make SONIC_CONFIG_BUILD_JOBS=1 all
'''
}
}

}
post {

success {
archiveArtifacts(artifacts: 'target/**')
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
}
fixed {
slackSend(color:'#00FF00', message: "Build job back to normal: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
}
regression {
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
}
}
}

0 comments on commit 0c94f61

Please sign in to comment.