Skip to content

Commit

Permalink
Merge pull request #35 from fellrock/develop
Browse files Browse the repository at this point in the history
Update JenkinsFile
  • Loading branch information
fellrock authored Mar 9, 2024
2 parents bab31d2 + 04a9208 commit dd13e8e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions jenkins/jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,21 @@ pipeline {
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()

// Executar o comando curl e capturar a saída
def process = curlCommand.execute()
process.waitFor()

// Verificar o código de saída
def curlExitCode = process.exitValue()
echo "curl result: ${curlExitCode}"

// Exibir a saída do comando
def curlOutput = process.text
echo "curl output: ${curlOutput}"

if (curlExitCode != '0') {
// Verificar se o comando falhou
if (curlExitCode != 0) {
error "Failed to copy files to Nginx server. Check logs for details."
}
} catch (Exception e) {
Expand Down

0 comments on commit dd13e8e

Please sign in to comment.