1 Star 0 Fork 284

陈晓虎/json-flow-ui

forked from JackRolling/jsonflow-ui 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Jenkinsfile 2.59 KB
一键复制 编辑 原始数据 按行查看 历史
陈晓虎 提交于 2022-11-10 16:30 . add jenkinsfile
pipeline {
agent any
stages {
stage('scm') {
steps {
echo 'scm_step_start'
echo 'scm_step_end'
}
}
stage('ScaBlocking'){
steps{
script{
sh '/opt/seczone/appcheck/app-check.sh --filePath "$JENKINS_HOME"/workspace/cxh-pipline-01 --cliMode portal --portalIp 10.0.1.236:30000 --projectName pipline2022 --appName pipline-01 --token b3JnYWRtaW4xMjNAc2Vjem9uZS5jbjpmZGYwNzQ3ZTAxMTU0Y2QwOGE4MGI1OTNmYjJhYTBmZg== --mergeMode FULL '
wrap([$class: 'BuildUser']) {
script {
BUILD_USER = "${env.BUILD_USER}"
BUILD_NUMBER = "${env.BUILD_NUMBER}"
}
}
def tep = "${BUILD_TIMESTAMP}".replaceAll("\\s",",")
def response = httpRequest url:"http://10.0.1.236:30000/sca/jenkins/block/result/query?projectName=pipline2022&appName=pipline-01&buildUser=${BUILD_USER}&buildNo=${BUILD_NUMBER}&buildTime=${tep}",customHeaders: [ [name: "Authorization", value: "BASIC-API:b3JnYWRtaW4xMjNAc2Vjem9uZS5jbjpmZGYwNzQ3ZTAxMTU0Y2QwOGE4MGI1OTNmYjJhYTBmZg=="] ]
println('Response: '+response.content)
def props = readJSON text: response.content
def status = props['status']
def data = props['data']
if(status ==0){
def msg = data['msg']
error(msg)
}else{
println('ProjectName: '+data['projectName'])
println('AppName: '+data['appName'])
println('Block Msg Send Switch(Email/Dingding): '+data['blockEmailSwitch']+'/'+data['blockDingSwitch'])
println('Report Msg Send Switch(Email/Dingding): '+data['repoartAppEmailSwitch']+'/'+data['repoartDingSwitch'])
println('Alert Checking: '+data['alarmSwitch'])
def blockWarning = data['blockWarning']
if(blockWarning){
println('告警信息: ')
println(blockWarning)
}else{
//println('暂无告警信息')
}
println('Block Checking: '+data['blockAlarmSwitch'])
def terminate = data['terminate']
if('1'.equals(terminate)){
println('阻断构建原因: ')
def blockInfo = data['blockInfo']
println(blockInfo)
println('terminate: '+terminate)
error('阻塞构建')
}
}
}
}
}
stage('build') {
steps {
echo 'build_step_start'
echo 'build_step_end'
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/chen_xiao_hu/json-flow-ui.git
git@gitee.com:chen_xiao_hu/json-flow-ui.git
chen_xiao_hu
json-flow-ui
json-flow-ui
master

搜索帮助