From fc1be1f53ac4d3c1f4547eea4a2c86bae690d35f Mon Sep 17 00:00:00 2001 From: fellrock Date: Sat, 9 Mar 2024 16:34:38 -0300 Subject: [PATCH] Update JenkinsFile --- jenkins/jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jenkins/jenkinsfile b/jenkins/jenkinsfile index fbc5696..4389a20 100644 --- a/jenkins/jenkinsfile +++ b/jenkins/jenkinsfile @@ -27,10 +27,13 @@ pipeline { stage('Copy to Nginx Server') { steps { script { - def curlOutput = sh(script: 'curl -T . http://172.17.0.5:80/mnt/user/appdata/nginx/www', returnStatus: true).trim() - echo "curl result: ${curlOutput}" + def curlOutput = sh(script: 'curl -T . http://172.17.0.5:80/mnt/user/appdata/nginx/www', returnStdout: true, returnStatus: true).trim() + def curlExitCode = sh(script: 'echo $?', returnStatus: true).trim() - if (curlOutput != '0') { + echo "curl result: ${curlExitCode}" + echo "curl output: ${curlOutput}" + + if (curlExitCode != '0') { error "Failed to copy files to Nginx server. Check logs for details." } }