fix: Fix Jenkinsfile syntax errors
- Fix indentation issues in pipeline stages - Fix missing stage separation causing compilation error - Ensure proper stage closure and formatting - This resolves the 'Expected a stage @ line 131' error
This commit is contained in:
parent
4d7b72d9e5
commit
fea1b828ec
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
@ -1,6 +1,7 @@
|
||||
pipeline {
|
||||
agent any
|
||||
options {
|
||||
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||
timeout(time: 60, unit: 'MINUTES') // 增加到60分钟
|
||||
timestamps()
|
||||
@ -10,7 +11,8 @@ pipeline {
|
||||
// 使用系统默认或Jenkins节点上已安装的JDK
|
||||
// 不再强制指定JAVA_HOME,让Jenkins自动检测
|
||||
|
||||
// 目标服务器配置 DEPLOY_SERVER = '116.62.163.84'
|
||||
// 目标服务器配置
|
||||
DEPLOY_SERVER = '116.62.163.84'
|
||||
|
||||
// Docker相关环境变量
|
||||
IMAGE_NAME = 'jenkins-demo'
|
||||
@ -121,8 +123,7 @@ pipeline {
|
||||
"""
|
||||
|
||||
echo "✅ SonarQube代码扫描完成"
|
||||
} catch (Exception e) {
|
||||
echo "⚠️ SonarQube扫描失败,继续构建流程: ${e.getMessage()}"
|
||||
} catch (Exception e) { echo "⚠️ SonarQube扫描失败,继续构建流程: ${e.getMessage()}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -143,7 +144,9 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
} stage('构建Docker镜像') {
|
||||
}
|
||||
|
||||
stage('构建Docker镜像') {
|
||||
steps {
|
||||
echo '🐳 构建Docker镜像...'
|
||||
script {
|
||||
|
Loading…
x
Reference in New Issue
Block a user