有人能告诉我这一步有什么问题吗?我需要检查,应用程序已部署,网站已启动^
stage('Check Availability') {
agent any
steps {
timeout(time: 15, unit: 'SECONDS') {
waitUntil {
try {
sh "curl -s --head --request GET localhost:8081/actuator/health | grep '200'"
return true
} catch (Exception e) {
return false
}
}
}
}
}
但是我不明白groovy语法有什么问题。现在我收到错误。
WorkflowScript: 50: Expected a step @ line 50, column 15.
try {
^
http://prntscr.com/jdycje
以下作品适合我:
Pipline {
agent any
timeout(time: 15, unit: 'SECONDS') {
stage('Check Availability') {
steps {
waitUntil {
try {
sh "curl -s --head --request GET localhost:8081/actuator/health | grep '200'"
return true
} catch (Exception e) {
return false
}
}
}
}
}
}