Skip to content

Commit 60c452e

Browse files
authored
[jenkins] Add Barefoot 201911 Jenkins job (sonic-net#87)
Signed-off-by: Andriy Kokhan <[email protected]>
1 parent 25c19dd commit 60c452e

File tree

2 files changed

+75
-4
lines changed

2 files changed

+75
-4
lines changed

jenkins/barefoot/buildimage-bf-201904/Jenkinsfile

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
pipeline {
22
agent { node { label 'jenkins-workers-slow' } }
33

4+
options {
5+
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30'))
6+
7+
}
8+
9+
triggers {
10+
pollSCM('@midnight')
11+
}
12+
413
stages {
514
stage('Prepare') {
615
steps {
7-
step([$class: 'WsCleanup'])
8-
checkout([$class: 'GitSCM',
9-
branches: [[name: 'refs/heads/201904']],
16+
17+
checkout([$class: 'GitSCM',
18+
branches: [[name: 'refs/heads/201904']],
1019
extensions: [[$class: 'SubmoduleOption',
1120
disableSubmodules: false,
1221
parentCredentials: false,
@@ -24,7 +33,7 @@ pipeline {
2433
2534
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
2635
27-
make configure PLATFORM=mellanox
36+
make configure PLATFORM=barefoot
2837
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-barefoot.bin
2938
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-aboot-barefoot.swi
3039
'''
@@ -43,5 +52,8 @@ make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-aboot-barefoot.swi
4352
regression {
4453
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
4554
}
55+
cleanup {
56+
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
57+
}
4658
}
4759
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
pipeline {
2+
agent { node { label 'jenkins-workers-slow' } }
3+
4+
options {
5+
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30'))
6+
7+
}
8+
9+
triggers {
10+
pollSCM('@midnight')
11+
}
12+
13+
stages {
14+
stage('Prepare') {
15+
steps {
16+
17+
checkout([$class: 'GitSCM',
18+
branches: [[name: 'refs/heads/201911']],
19+
extensions: [[$class: 'SubmoduleOption',
20+
disableSubmodules: false,
21+
parentCredentials: false,
22+
recursiveSubmodules: true,
23+
reference: '',
24+
trackingSubmodules: false]],
25+
userRemoteConfigs: [[url: 'http://github.com/Azure/sonic-buildimage']]])
26+
}
27+
}
28+
29+
stage('Build') {
30+
steps {
31+
sh '''
32+
#!/bin/bash -xe
33+
34+
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
35+
36+
make configure PLATFORM=barefoot
37+
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-barefoot.bin
38+
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-aboot-barefoot.swi
39+
'''
40+
}
41+
}
42+
43+
}
44+
post {
45+
46+
success {
47+
archiveArtifacts(artifacts: 'target/**')
48+
}
49+
fixed {
50+
slackSend(color:'#00FF00', message: "Build job back to normal: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
51+
}
52+
regression {
53+
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
54+
}
55+
cleanup {
56+
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)