In Jenkins, how do I cat a file that's in my filesystem and not part of any job's workspace?
Go to "manage jenkins", then "script console." To cat your file, substitute your file name and path for /var/lib/jenkins/evn.sh
in the below code, paste the code into the box, and hit "Run":
def sout = new StringBuffer(), serr = new StringBuffer()
def proc ='cat /var/lib/jenkins/env.sh'.execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
return sout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With