Skip to content

Commit

Permalink
Merge pull request #34 from fellrock/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
fellrock authored Mar 9, 2024
2 parents 0d23b25 + 77edce2 commit bab31d2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions jenkins/jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ 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', returnStdout: true, returnStatus: true).trim()
def curlExitCode = sh(script: 'echo $?', returnStatus: true).trim()
try {
def curlCommand = 'curl -T . http://172.17.0.5:80/mnt/user/appdata/nginx/www'
echo "Running command: ${curlCommand}"

def curlOutput = sh(script: curlCommand, returnStdout: true, returnStatus: true).trim()
def curlExitCode = sh(script: 'echo $?', returnStatus: true).trim()

echo "curl result: ${curlExitCode}"
echo "curl output: ${curlOutput}"
echo "curl result: ${curlExitCode}"
echo "curl output: ${curlOutput}"

if (curlExitCode != '0') {
error "Failed to copy files to Nginx server. Check logs for details."
if (curlExitCode != '0') {
error "Failed to copy files to Nginx server. Check logs for details."
}
} catch (Exception e) {
error "An error occurred while running the 'curl' command. Error: ${e.message}"
}
}
}
Expand Down

0 comments on commit bab31d2

Please sign in to comment.