110 lines
2.9 KiB
Plaintext
Executable File
110 lines
2.9 KiB
Plaintext
Executable File
library 'z-common@feat-231024'
|
|
|
|
pipeline {
|
|
agent {
|
|
kubernetes {
|
|
inheritFrom "xuanim"
|
|
yamlFile 'misc/ci/normal.yaml'
|
|
}
|
|
}
|
|
|
|
options {
|
|
skipDefaultCheckout()
|
|
}
|
|
|
|
environment {
|
|
TZ="Asia/Shanghai"
|
|
|
|
ZENTAO_RELEASE_PATH = "${WORKSPACE}/release"
|
|
|
|
// DOWNGRADE_VERSIONS = "7.2"
|
|
DOWNGRADE_VERSIONS = "7.2,7.1,7.0"
|
|
}
|
|
|
|
stages {
|
|
|
|
stage("全量降级") {
|
|
|
|
agent {
|
|
kubernetes {
|
|
inheritFrom "zentao-package dind xuanim"
|
|
yamlFile 'misc/ci/basic-build.yaml'
|
|
}
|
|
}
|
|
|
|
stages {
|
|
stage("Pull") {
|
|
steps {
|
|
checkout scm
|
|
}
|
|
}
|
|
|
|
stage("Setup Global Env") {
|
|
steps {
|
|
script {
|
|
// def ximUsers = sh(returnStdout: true,script: 'jq -r .notice.users < ci.json').trim()
|
|
env.XIM_USERS = "qishiyao"
|
|
// env.XIM_GROUPS = "31a0008b-6e3e-4b7f-9b7b-396a46b1f8f4"
|
|
|
|
env.GIT_BRANCH = "master"
|
|
env.DOWNGRADE_GIT_REPO = sh(returnStdout: true,script: 'jq -r .pkg.downgrade.gitRepo < ci.json').trim()
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
stage("Downgrade") {
|
|
stages {
|
|
|
|
stage("test downgrade") {
|
|
steps {
|
|
sh 'env'
|
|
replayCheckout([
|
|
[name: "downRepo", subDir: true, url: "${env.DOWNGRADE_GIT_REPO}", credentialsId: "git-zcorp-cc-jenkins-bot-http", branch: "downgrade/blank"]
|
|
])
|
|
|
|
container('package') {
|
|
sh 'echo ${GIT_BRANCH}'
|
|
sh '''find module -type d -name 'test' -maxdepth 2 -exec rm -rf {} +'''
|
|
|
|
withCredentials([gitUsernamePassword(credentialsId: 'git-zcorp-cc-jenkins-bot-http', gitToolName: 'Default')]) {
|
|
sh '${ZENTAO_BUILD_PATH}/script/downgrade/fullDowngrade.sh -r $PWD -d downRepo -i -s -o "$ZENTAO_RELEASE_PATH" -p "$DOWNGRADE_VERSIONS" framework lib module/*'
|
|
}
|
|
sh 'ls -l $ZENTAO_RELEASE_PATH'
|
|
sh 'test ! -f ${ZENTAO_RELEASE_PATH}/downgradeReport.html'
|
|
}
|
|
}
|
|
|
|
post {
|
|
failure {
|
|
container('package') {
|
|
sh 'mkdir ./report && cp ${ZENTAO_RELEASE_PATH}/downgradeReport.html ./report'
|
|
}
|
|
|
|
publishHTML([
|
|
allowMissing: true,
|
|
alwaysLinkToLastBuild: false,
|
|
keepAll: true,
|
|
reportDir: './report',
|
|
reportFiles: 'downgradeReport.html',
|
|
reportName: 'DowngradeReport'
|
|
])
|
|
|
|
ximNotify(title: "禅道全量降级失败", content: "[PHP语法错误报告]($BUILD_URL/DowngradeReport/)")
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
} // End Downgrade
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|