Skip to content

Commit 17f8fd8

Browse files
authored
[jenkins] ZTP build support (sonic-net#84)
1 parent e56638a commit 17f8fd8

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
pipeline {
2+
agent { node { label 'sonic-slave' } }
3+
4+
stages {
5+
stage('Prepare') {
6+
steps {
7+
dir('sonic-ztp') {
8+
checkout([$class: 'GitSCM',
9+
branches: [[name: '${sha1}']],
10+
userRemoteConfigs: [[url: 'http://github.com/Azure/sonic-ztp',
11+
refspec: '+refs/pull/*:refs/remotes/origin/pr/*']]])
12+
}
13+
}
14+
}
15+
16+
stage('Build') {
17+
steps {
18+
sh './scripts/common/sonic-ztp/build.sh'
19+
}
20+
}
21+
}
22+
post {
23+
success {
24+
archiveArtifacts(artifacts: 'target/*.deb')
25+
}
26+
}
27+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
pipeline {
2+
agent { node { label 'sonic-slave' } }
3+
4+
options {
5+
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10'))
6+
7+
}
8+
9+
triggers {
10+
pollSCM('H/10 * * * *')
11+
}
12+
13+
stages {
14+
stage('Prepare') {
15+
steps {
16+
dir('sonic-ztp') {
17+
checkout([$class: 'GitSCM',
18+
branches: [[name: 'refs/heads/master']],
19+
userRemoteConfigs: [[url: 'http://github.com/Azure/sonic-ztp']]])
20+
}
21+
}
22+
}
23+
24+
stage('Build') {
25+
steps {
26+
sh './scripts/common/sonic-ztp-build/build.sh'
27+
}
28+
}
29+
}
30+
post {
31+
success {
32+
archiveArtifacts(artifacts: 'target/*.deb')
33+
}
34+
fixed {
35+
slackSend(color:'#00FF00', message: "Build job back to normal: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
36+
}
37+
regression {
38+
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
39+
}
40+
}
41+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash -ex
2+
3+
pushd sonic-ztp
4+
5+
dpkg-buildpackage -rfakeroot -b -us -uc
6+
7+
popd
8+
9+
mkdir -p target
10+
cp *.deb target/
11+

0 commit comments

Comments
 (0)