Skip to content

Commit

Permalink
[jenkins] Add Barefoot 201911 Jenkins job (sonic-net#87)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Kokhan <akokhan@barefootnetworks.com>
  • Loading branch information
akokhan committed Mar 19, 2020
1 parent 25c19dd commit 60c452e
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 4 deletions.
20 changes: 16 additions & 4 deletions jenkins/barefoot/buildimage-bf-201904/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
pipeline {
agent { node { label 'jenkins-workers-slow' } }

options {
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30'))

}

triggers {
pollSCM('@midnight')
}

stages {
stage('Prepare') {
steps {
step([$class: 'WsCleanup'])
checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/201904']],

checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/201904']],
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
Expand All @@ -24,7 +33,7 @@ pipeline {
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
make configure PLATFORM=mellanox
make configure PLATFORM=barefoot
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-barefoot.bin
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-aboot-barefoot.swi
'''
Expand All @@ -43,5 +52,8 @@ make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-aboot-barefoot.swi
regression {
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
}
cleanup {
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
}
}
}
59 changes: 59 additions & 0 deletions jenkins/barefoot/buildimage-bf-201911/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
pipeline {
agent { node { label 'jenkins-workers-slow' } }

options {
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30'))

}

triggers {
pollSCM('@midnight')
}

stages {
stage('Prepare') {
steps {

checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/201911']],
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false]],
userRemoteConfigs: [[url: 'http://github.com/Azure/sonic-buildimage']]])
}
}

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=barefoot
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-barefoot.bin
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-aboot-barefoot.swi
'''
}
}

}
post {

success {
archiveArtifacts(artifacts: 'target/**')
}
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>)")
}
cleanup {
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
}
}
}

0 comments on commit 60c452e

Please sign in to comment.