Does anyone know how to add assembly information to an existing Jenkins assembly?
What I'm trying to do is replace the build number 1 with the actual full version number that the assembly represents. I can do this manually by going to http: // MyJenkinsServer / job / [event_name] / [buildnumber] / configure
I tried redesigning the headers using chrome, seeing what it sends to the server, and found the following:
Request URL:http://<server>/job/test_job/1/configSubmit
Request Method:POST
Status Code:200 OK
Request Headers view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:192
Content-Type:application/x-www-form-urlencoded
Cookie:hudson_auto_refresh=false; JSESSIONID=qbn3q22phkbc12f1ikk0ssijb; screenResolution=1920x1200
Referer:http://<server>/job/test_job/1/configure
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
Form Data view URL encoded
displayName:#1
description:test4
core:apply:true
json:{"displayName": "#1", "description": "test4", "": "test4", "core:apply": "true"}**
Response Headers view source
Content-Length:155
Content-Type:text/html;charset=UTF-8
Server:Jetty(8.y.z-SNAPSHOT)
This at least gives me the form options that I need for POST. So from this, I came up with the following python3 code:
import requests
params={"displayName":"Hello World",
"description":"This is my description",
"":"This is my description",
"core:apply":"true"}
a = requests.post("http://myjenkinsserver/job/test_jira_job_update/1/configSubmit", data=params, auth=( username, pwd), headers={"content-type":"text/html;charset=UTF-8"} )
if a.raw.status != 200:
print("***ERROR***")
print(a.raw.status)
print(a.raw.reason)
but unfortunately this happened with the following error:
***ERROR***
400
Nothing is submitted
Any ideas what I'm doing wrong? Is my approach to this problem completely wrong?