This commit is contained in:
1 parent
faf352663e
commit
72e089acae
1 file changed
+28
-24
Vendored
+28
-24
@@ -1,33 +1,37 @@
|
|||||||
pipeline {
|
properties([
|
||||||
agent any
|
disableConcurrentBuilds(),
|
||||||
options { timeout(time: 60, unit: 'SECONDS') }
|
buildDiscarder(logRotator(daysToKeepStr: '60', numToKeepStr: '60', artifactDaysToKeepStr: '15', artifactNumToKeepStr: '15'))
|
||||||
stages {
|
])
|
||||||
stage('Checkout and identify change') {
|
|
||||||
steps {
|
timeout(time: 60, unit: 'SECONDS') {
|
||||||
|
node {
|
||||||
|
try {
|
||||||
|
stage('检出与变更信息') {
|
||||||
checkout scm
|
checkout scm
|
||||||
echo "BRANCH_NAME=${env.BRANCH_NAME ?: ''}"
|
echo "BRANCH_NAME=${env.BRANCH_NAME ?: ''}"
|
||||||
echo "CHANGE_ID=${env.CHANGE_ID ?: ''}"
|
echo "CHANGE_ID=${env.CHANGE_ID ?: ''}"
|
||||||
echo "CHANGE_TARGET=${env.CHANGE_TARGET ?: ''}"
|
echo "CHANGE_TARGET=${env.CHANGE_TARGET ?: ''}"
|
||||||
script {
|
def scenario = readFile('ci/scenario.txt').trim()
|
||||||
def scenario = readFile('ci/scenario.txt').trim()
|
if (!(scenario in ['success', 'unstable', 'failure'])) {
|
||||||
if (!(scenario in ['success', 'unstable', 'failure'])) {
|
error("Unsupported demo scenario: ${scenario}")
|
||||||
error("Unsupported demo scenario: ${scenario}")
|
|
||||||
}
|
|
||||||
env.SCENARIO = scenario
|
|
||||||
}
|
}
|
||||||
|
env.SCENARIO = scenario
|
||||||
|
env.RUN_SECONDS = '1'
|
||||||
|
env.LOG_LINES = '25'
|
||||||
|
env.TARGET_ENV = 'sg'
|
||||||
|
env.RELEASE_VERSION = readFile('VERSION').trim()
|
||||||
|
def expected = [success: 'SUCCESS', unstable: 'UNSTABLE', failure: 'FAILURE'][scenario]
|
||||||
|
currentBuild.description = '[演示数据] synthetic=true expected=' + expected
|
||||||
|
}
|
||||||
|
stage('构建与报告') {
|
||||||
|
int status = sh(returnStatus: true, script: 'sh ci/demo-build.sh')
|
||||||
|
junit 'reports/*.xml'
|
||||||
|
if (status != 0) error("Demo build exited with status ${status}")
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
stage('归档') {
|
||||||
|
archiveArtifacts artifacts: 'artifacts/*', allowEmptyArchive: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build and report') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
int status = sh(script: 'sh ci/demo-build.sh', returnStatus: true)
|
|
||||||
junit 'reports/*.xml'
|
|
||||||
if (status != 0) error("Demo build exited with status ${status}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always { archiveArtifacts artifacts: 'artifacts/*', allowEmptyArchive: true }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user