Skip to content

Commit

Permalink
Checks if environment actually checks it
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Jan 14, 2024
1 parent 7178295 commit e5a763b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ pipeline {
echo "HTTP response: $response"

if (code == 200) {
tempStreams = sh(script: "echo '$response' | jq -M '.streams'", returnStdout: true).trim()
int streams = Integer.parseInt(tempStreams)
if (streams > 0) {
echo "Preexisting active streams: $streams, not deploying"
proceed = "no"
} else {
echo "No preexisting active streams, deploying"
if (response.contains("streams")) {
tempStreams = sh(script: "echo '$response' | jq -M '.streams'", returnStdout: true).trim()
int streams = Integer.parseInt(tempStreams)
if (streams > 0) {
echo "Preexisting active streams: $streams, not deploying"
proceed = "no"
} else {
echo "No preexisting active streams, deploying"
}
}
}
}
Expand Down

0 comments on commit e5a763b

Please sign in to comment.