You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

119 lines
4.1 KiB

pipeline {
// agent any
agent{
label 'superMac'
// customWorkspace 'D:/Jenkins/workspace/test'
}
environment {
sharePath = '${WORKSPACE}/u2china_share_proj'
clientPath = '${WORKSPACE}/u2china_cli_proj'
serverPath = '${WORKSPACE}/u2china_svr_proj'
branch = "${BranchName}" // trunk , branch
commitType = "${CommitType}" // server , client , serverAndclient
//shareBranch = "${ShareBranchName}" // trunk , branch
svn = "/usr/local/bin/svn"
}
stages {
stage("svn share_proj"){
steps{
sh label: '', script: """
chmod 774 ${WORKSPACE}/CheckoutShare.py
python3 ${WORKSPACE}/CheckoutShare.py ${env.branch} "share"
"""
// checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: '48c5097b-b47f-48fc-9704-007c7b9d6498', depthOption: 'infinity', ignoreExternalsOption: true, local: './u2china_share_proj', remote: 'https://119.91.229.66/svn/u2china_share_proj/trunk']], quietOperation: true, workspaceUpdater: [$class: 'UpdateWithRevertUpdater']])
}
}
stage("svn checkout"){
steps{
sh label: '', script: """
chmod 774 ${env.sharePath}/JenkinsFile/SVNCmd.py
python3 ${env.sharePath}/JenkinsFile/SVNCmd.py ${env.branch} "update" ${env.commitType}
"""
}
}
stage("CleanExcelData"){
steps{
sh label: '', script: """
chmod 774 ${env.sharePath}/JenkinsFile/CleanExcelData.py
python3 ${env.sharePath}/JenkinsFile/CleanExcelData.py
"""
}
}
stage('Excel Export')
{
steps
{
script{
sh """
cd ${env.sharePath}/ExcelExport
chmod 774 excelTolua.py
/usr/local/bin/python3 ./excelTolua.py
chmod 774 ExportLanguageToText.py
/usr/local/bin/python3 ./ExportLanguageToText.py
"""
}
}
}
stage('Build proto')
{
steps
{
script{
sh """
cd ${env.sharePath}/protocol
sh ./genmac.sh
cd ${env.sharePath}/protocol
chmod 774 export_lua.py
/usr/local/bin/python3 ./export_lua.py
"""
}
}
}
stage("run speed"){
steps{
sh label: '', script: """
cd ${env.sharePath}/ExcelExport
chmod 774 ./run_SpeedMac.sh
sh ./run_SpeedMac.sh
"""
}
}
stage("svn Commit"){
steps{
echo "svn Commit ......"
sh label: '', script: """python3 ${env.sharePath}/JenkinsFile/SVNCmd.py ${env.branch} "commit" ${env.commitType} """
}
}
}
post
{
success
{
wrap([$class: 'BuildUser']) {
script {
buildUser = "${env.BUILD_USER}"
}
}
sh label: '', script: """sh ${env.sharePath}/JenkinsFile/feishu.sh SUCCESS ${env.JOB_NAME} ${env.BUILD_NUMBER} ${env.branch} ${env.commitType} ${buildUser} """
}
failure
{
wrap([$class: 'BuildUser']) {
script {
buildUser = "${env.BUILD_USER}"
}
}
sh label: '', script: """sh ${env.sharePath}/JenkinsFile/feishu.sh FAILURE ${env.JOB_NAME} ${env.BUILD_NUMBER} ${env.branch} ${env.commitType} ${buildUser} """
echo "FAILURE"
}
}
}