I'm trying to capture the output of the startup script of Jenkins, but all I get is an empty output.
The output of Jenkins appears in the terminal
#!/bin/bash
function sendNotificationOnSlack() {
curl -X POST ...
}
export -f sendNotificationOnSlack
java -Dhudson.DNSMultiCast.disabled=true -jar /usr/local/opt/jenkins/libexec/jenkins.war --httpPort=3999 | awk '/Jenkins is fully up and running/ {system("bash -c sendNotificationOnSlack")}'
I've tried even to capture the output of the TTY, but appears as empty
#!/bin/bash
currentTTY=$(tty)
echo $currentTTY
function sendNotificationOnSlack() {
curl -X POST ...
}
export -f sendNotificationOnSlack
java -Dhudson.DNSMultiCast.disabled=true -jar /usr/local/opt/jenkins/libexec/jenkins.war --httpPort=3999
tail -f $currentTTY | awk '/Jenkins is fully up and running/ {system("bash -c sendNotificationOnSlack")}'
I tried to search everywhere but I can't find the jenkins.log file, anyone has any suggestion?