Skip to content

Commit

Permalink
add 5 pipeline file (sonic-net#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
liushilongbuaa authored Oct 26, 2020
1 parent 8b338ec commit 05e0ed5
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 0 deletions.
66 changes: 66 additions & 0 deletions jenkins/barefoot/buildimage-bf-all/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
pipeline {
agent { node { label 'jenkins-workers-slow' } }

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

environment {
SONIC_TEAM_WEBHOOK = credentials('public-jenkins-builder')
}

triggers {
pollSCM('H 2 * * *')
}

stages {
stage('Prepare') {
steps {
milestone(ordinal: 1, label: "BUILD_START_MILESTONE")
step([$class: 'WsCleanup'])
checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/master']],
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false],
[$class: 'LocalBranch',
localBranch: "**"]],
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
BLDENV=stretch make stretch
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/*.gz, target/debs/*.deb, target/sonic-*.bin, target/sonic-*.swi, target/python-wheels/*.whl, target/python-wheels/*.log, target/*.log, target/debs/*.log')
}
fixed {
slackSend(color:'#00FF00', message: "Build job back to normal: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
}
regression {
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
}
cleanup {
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
}
}
}
59 changes: 59 additions & 0 deletions jenkins/broadcom/buildimage-brcm-201811/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: '20'))
}

triggers {
pollSCM('H */12 * * *')
}

stages {
stage('Prepare') {
steps {
milestone(ordinal: 1, label: "BUILD_START_MILESTONE")
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/201811']],
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false],
[$class: 'LocalBranch',
localBranch: "**"]],
userRemoteConfigs: [[url: 'http://github.com/Azure/sonic-buildimage']]])
}
}

stage('Build') {
steps {
sh '''#!/bin/bash
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
make configure PLATFORM=broadcom
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-broadcom.bin
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-aboot-broadcom.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)
}
}
}
59 changes: 59 additions & 0 deletions jenkins/broadcom/buildimage-brcm-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: '20'))
}

triggers {
pollSCM('H */12 * * *')
}

stages {
stage('Prepare') {
steps {
milestone(ordinal: 1, label: "BUILD_START_MILESTONE")
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/201911']],
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false],
[$class: 'LocalBranch',
localBranch: "**"]],
userRemoteConfigs: [[url: 'http://github.com/Azure/sonic-buildimage']]])
}
}

stage('Build') {
steps {
sh '''#!/bin/bash
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
make configure PLATFORM=broadcom
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-broadcom.bin
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-aboot-broadcom.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)
}
}
}
64 changes: 64 additions & 0 deletions jenkins/mellanox/buildimage-mlnx-201911-t0/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
pipeline {
agent { node { label 'jenkins-workers-slow' } }

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

environment {
SONIC_TEAM_WEBHOOK = credentials('public-jenkins-builder')
}

triggers {
pollSCM('@midnight')
}

stages {
stage('Prepare') {
steps {
milestone(ordinal: 1, label: "BUILD_START_MILESTONE")
step([$class: 'WsCleanup'])
checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/201911-t0']],
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false],
[$class: 'LocalBranch',
localBranch: "**"]],
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=mellanox
make SONIC_CONFIG_BUILD_JOBS=1 target/sonic-mellanox.bin
'''
}
}

}
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>)")
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
}
regression {
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
}
cleanup {
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
}
}
}
65 changes: 65 additions & 0 deletions jenkins/mellanox/buildimage-mlnx-rpc-all/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
pipeline {
agent { node { label 'jenkins-workers-slow' } }

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

environment {
SONIC_TEAM_WEBHOOK = credentials('public-jenkins-builder')
}

triggers {
pollSCM 'H 2 * * *'
}

stages {
stage('Prepare') {
steps {
milestone(ordinal: 1, label: "BUILD_START_MILESTONE")
step([$class: 'WsCleanup'])
checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/master']],
extensions: [[$class: 'SubmoduleOption',
disableSubmodules: false,
parentCredentials: false,
recursiveSubmodules: true,
reference: '',
trackingSubmodules: false],
[$class: 'LocalBranch',
localBranch: "**"]],
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=mellanox SKU=ACS-MSN2700
BLDENV=stretch make stretch
make SONIC_CONFIG_BUILD_JOBS=1 ENABLE_SYNCD_RPC=y all
'''
}
}
}

post {
success {
archiveArtifacts(artifacts: 'target/*.gz, target/debs/*.deb, target/sonic-*.bin')
}
fixed {
slackSend(color:'#00FF00', message: "Build job back to normal: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
}
regression {
slackSend(color:'#FF0000', message: "Build job Regression: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
office365ConnectorSend(webhookUrl: "${env.SONIC_TEAM_WEBHOOK}")
}
cleanup {
cleanWs(disableDeferredWipeout: false, deleteDirs: true, notFailBuild: true)
}
}
}

0 comments on commit 05e0ed5

Please sign in to comment.