stahlscott / jenkins-parser

Jenkins XML feed RSS parser
0 stars 0 forks source link

[Question] #1

Open EdwinFairchild opened 2 years ago

EdwinFairchild commented 2 years ago

Do you know if it possible to fetch the xml file from a Jenkins build so that this script can parse it? I have tried things like beautiful soup but keep getting authentication issues, since this is obviously a server that requires log in to get to the rss xml file. Maybe there is a way jenkins can save that file else where and I can fetch it by ssh into the server.. any thoughts?

EdwinFairchild commented 2 years ago

figured out a way. Make an API token in Jenkins and then right before you call the run function I put this

stream = os.popen('curl -s -X POST -k --user edwin.amaya:yourTokenHere htps://path_to_jenkins_job_/rssAll  > rssAll.xml')

output = stream.read()

output