Skip to content

Commit

Permalink
Transfer from freestyle project to pipeline project. update one pipel…
Browse files Browse the repository at this point in the history
…ine file (sonic-net#165)

* update one pipeline file(Jenkins/common/python-swssdk-build)

* update path

* Update Jenkinsfile

Co-authored-by: Shilong Liu <[email protected]>
  • Loading branch information
liushilongbuaa and liushilongbuaa authored Sep 23, 2020
1 parent 5db0ef4 commit 9d34835
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions jenkins/common/python-swsssdk-build/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
pipeline {
agent { node { label 'sonic-slave' } }

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

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

triggers {
cron('H * * * *')
}

stages {
stage('Prepare') {
steps {
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: 'https://github.com/Azure/sonic-py-swsssdk']]])
}
}

stage('Build') {
steps {
sh '''#!/bin/bash -x
python2 setup.py bdist_wheel
python3 setup.py bdist_wheel
mkdir -p target/python-wheels/
cp dist/swsssdk-2.0.1-{py2,py3}-none-any.whl target/python-wheels/
'''
}
}

}
post {
success {
archiveArtifacts(artifacts: 'target/python-wheels/*.whl', fingerprint: true)
}
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 9d34835

Please sign in to comment.