这个舞台没有台阶 蓝海
This stage has no steps Blue ocean
我正在使用 Blue ocean 创建 Jenkins 管道。
现在我尝试将 SonarQube 分析添加到流程中。但是当我 运行 流程时,它说:
No steps This stage has no steps
舞台是这样的:
stage('Analysis') {
steps {
script {
if (env.BRANCH_NAME == 'develop') {
withSonarQubeEnv('SonarQube Server') {
bat 'mvn sonar:sonar'
def qualitygate = waitForQualityGate()
if (qualitygate.status != "OK") {
error "Pipeline aborted due to quality gate coverage failure: ${qualitygate.status}"
}
}
}
}
}
}
开发分支中的流程是运行ning:
我不知道为什么詹金斯会说这个错误。有人可以帮我解决这个问题吗?
更改我的流程以使用 when 关键字:
stage('SonarQube analysis') {
when {
branch 'develop'
}
steps {
withSonarQubeEnv('SonarQube') {
bat 'mvn sonar:sonar'
}
}
}
stage("SonarQube Quality Gate") {
when {
branch 'develop'
}
steps {
timeout(time: 10, unit: 'MINUTES') {
script {
sleep 120
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
}
}
我正在使用 Blue ocean 创建 Jenkins 管道。
现在我尝试将 SonarQube 分析添加到流程中。但是当我 运行 流程时,它说:
No steps This stage has no steps
舞台是这样的:
stage('Analysis') {
steps {
script {
if (env.BRANCH_NAME == 'develop') {
withSonarQubeEnv('SonarQube Server') {
bat 'mvn sonar:sonar'
def qualitygate = waitForQualityGate()
if (qualitygate.status != "OK") {
error "Pipeline aborted due to quality gate coverage failure: ${qualitygate.status}"
}
}
}
}
}
}
开发分支中的流程是运行ning:
更改我的流程以使用 when 关键字:
stage('SonarQube analysis') {
when {
branch 'develop'
}
steps {
withSonarQubeEnv('SonarQube') {
bat 'mvn sonar:sonar'
}
}
}
stage("SonarQube Quality Gate") {
when {
branch 'develop'
}
steps {
timeout(time: 10, unit: 'MINUTES') {
script {
sleep 120
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
}
}