From f14fbee4c181d8573bebae3a884e32d23eff1d95 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sat, 13 Jul 2019 19:10:19 +0000 Subject: [PATCH] [jenkins]: move docker build into build.sh for sonic-swss build add trap to umount in case of build error --- jenkins/common/sonic-utilities-build-pr/Jenkinsfile | 8 +++----- jenkins/common/sonic-utilities-build/Jenkinsfile | 8 +++----- scripts/common/sonic-utilities-build/build.sh | 3 ++- scripts/common/sonic-utilities-build/test.sh | 0 4 files changed, 8 insertions(+), 11 deletions(-) mode change 100644 => 100755 scripts/common/sonic-utilities-build/build.sh mode change 100644 => 100755 scripts/common/sonic-utilities-build/test.sh diff --git a/jenkins/common/sonic-utilities-build-pr/Jenkinsfile b/jenkins/common/sonic-utilities-build-pr/Jenkinsfile index 11c248621f1c..bd36be8e313b 100644 --- a/jenkins/common/sonic-utilities-build-pr/Jenkinsfile +++ b/jenkins/common/sonic-utilities-build-pr/Jenkinsfile @@ -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) diff --git a/jenkins/common/sonic-utilities-build/Jenkinsfile b/jenkins/common/sonic-utilities-build/Jenkinsfile index 66911b9f6f74..7ef517511085 100644 --- a/jenkins/common/sonic-utilities-build/Jenkinsfile +++ b/jenkins/common/sonic-utilities-build/Jenkinsfile @@ -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) diff --git a/scripts/common/sonic-utilities-build/build.sh b/scripts/common/sonic-utilities-build/build.sh old mode 100644 new mode 100755 index 9bc80d29e233..fb693d7e630d --- a/scripts/common/sonic-utilities-build/build.sh +++ b/scripts/common/sonic-utilities-build/build.sh @@ -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 diff --git a/scripts/common/sonic-utilities-build/test.sh b/scripts/common/sonic-utilities-build/test.sh old mode 100644 new mode 100755