improve the authentication mechanism used to trigger Jenkins builds
At the moment we use this code:
cookie = "%s/secrets/jenkins-cookie.txt" % settings.BASE_DIR
url_rebuild = 'https://jenkins-lhcb-nightlies.web.cern.ch/job/...'
type = 'multipart/form-data'
commnad = [
'curl', '--cookie', cookie, ..., '-X', 'POST', url_rebuild
]
p1 = subprocess.Popen(commnad, stdout=subprocess.PIPE)
output = p1.communicate()[0]
repeated almost verbatim 3 times.
jenkins-cookie.txt
is updated regularly by an acron job of lhcbsoft, and copied to the host via scp.
Apart from having to rely on the curl
command, the use of jenkins-cookie.txt
is not practical on OpenShift (e.g. cannot scp to a pod).