diff --git a/Jenkinsfile b/Jenkinsfile index 0a8ef7c..35f0c13 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,16 +14,7 @@ pipeline { } stage('Execute Shell Command') { steps { - script { - try { - // 尝试执行shell命令 - sh label: '', script: 'echo 123' - } catch (err) { - // 如果执行时发生异常,则捕获并打印错误信息 - echo "Shell command execution failed: ${err.getMessage()}" - // 这里还可以添加其他处理错误的逻辑,比如发送通知、清理资源等 - } - } + sh returnStdout: true, script: 'echo 123' } } stage('sonar质量检测') { // 阶段3:使用Sonar进行代码质量检测