Skip to content

Commit

Permalink
[jenkins]: move docker build into build.sh for sonic-swss build
Browse files Browse the repository at this point in the history
add trap to umount in case of build error
  • Loading branch information
lguohan committed Jul 13, 2019
1 parent f5df271 commit f14fbee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
8 changes: 3 additions & 5 deletions jenkins/common/sonic-utilities-build-pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ pipeline {
stages {
stage('Prepare') {
steps {
step([$class: 'WsCleanup'])
checkout([$class: 'GitSCM',
dir('sonic-utilities') {
checkout([$class: 'GitSCM',
branches: [[name: '${sha1}']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'sonic-utilities']],
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://github.com/Azure/sonic-utilities',
refspec: '+refs/pull/*:refs/remotes/origin/pr/*']]])
}
copyArtifacts(projectName: 'sonic-swss-common-build', filter: '**/*.deb', target: 'swss-common', flatten: true)
copyArtifacts(projectName: '../vs/sonic-swss-build', filter: '**/*.deb', target: 'swss', flatten: true)
copyArtifacts(projectName: '../vs/sonic-sairedis-build', filter: '**/*.deb', target: 'sairedis', flatten: true)
Expand Down
8 changes: 3 additions & 5 deletions jenkins/common/sonic-utilities-build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ pipeline {
stages {
stage('Prepare') {
steps {
step([$class: 'WsCleanup'])
checkout([$class: 'GitSCM',
dir('sonic-utilities') {
checkout([$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'sonic-utilities']],
submoduleCfg: [],
userRemoteConfigs: [[url: 'https://github.com/Azure/sonic-utilities']]])
}
copyArtifacts(projectName: 'sonic-swss-common-build', filter: '**/*.deb', target: 'swss-common', flatten: true)
copyArtifacts(projectName: '../vs/sonic-swss-build', filter: '**/*.deb', target: 'swss', flatten: true)
copyArtifacts(projectName: '../vs/sonic-sairedis-build', filter: '**/*.deb', target: 'sairedis', flatten: true)
Expand Down
3 changes: 2 additions & 1 deletion scripts/common/sonic-utilities-build/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ EOF
chmod 755 build_sonic_utilities.sh

# Build sonic-utilities and copy resulting Debian package
docker run --rm=true --privileged -v $(pwd):/sonic -w /sonic -i sonic-slave-johnar ./build_sonic_utilities.sh
docker run --rm=true --privileged -v $(pwd):/sonic -w /sonic -i sonic-slave-stretch-johnar ./build_sonic_utilities.sh

cp sonic-utilities/deb_dist/python-sonic-utilities_*.deb buildimage/target/python-debs/

cd sairedis
Expand Down
Empty file modified scripts/common/sonic-utilities-build/test.sh
100644 → 100755
Empty file.

0 comments on commit f14fbee

Please sign in to comment.