-
-
Notifications
You must be signed in to change notification settings - Fork 74
How to trigger Jenkins 2.1 with parameters #132
Comments
What do you get when you this?
I would suspect its a Jenkins thing. The values are probably supplied by this plugin but not consumed by Jenkins. You may confirm that by changing the URL to, perhaps, an Apache installation and then check the logs of that to see what URL was actually invoked. If you dont have such installation, you can change URL to: Also is there any stacktrace in the logs of Bitbucket Server? |
I've changed it to your URL and i'm triggering it now. Thanks for your help. |
My log contains this: I think you should just remove EVERYTHING_URL= from your URL. This should work: |
Thank you for your quick reply, It seems that the plugin send Parameters but why Jenkins job not receiving them? FROM_REPO,TO_REPO,PULL_REQUEST_USER_DISPLAY_NAME - text parameters in the job. Do you have experience with sending parameters to Jenkins jobs? |
If you simply browse to that URL with Chrome or something. Does that work? |
No, it supposed to trigger a job in Jenkins, https://{my Jankins server}/job/{job name}/buildWithParameters?FROM_REPO=${PULL_REQUEST_FROM_REPO_NAME}&TO_REPO=${PULL_REQUEST_TO_REPO_NAME}&PULL_REQUEST_USER_DISPLAY_NAME=${PULL_REQUEST_USER_DISPLAY_NAME} The trigger is working, the variables are moving from Bitbucket (as you are getting them) but the Parameters in the job that supposed to be set by the variables from Bitbucket stays BLANK. For testing: if i'm sending this url: |
If you add a shell script build step, and execute |
lets make some order. for testing i'm using the next url: when i'm inserting it directly in the browser - Jenkins is triggered and all the Parameters are in. maybe credentials issue? |
The parameters should be exposed as environment variables, it says so here. So you use POST method as request method in the plugin? If you add the parameters in the URL you must use GET. Selecting GET should be equivalent to this:
And if you actually want to use POST method. I would try adding this to post content field and remove it from the URL:
|
Where do i need to run the curl command (does it matter?) and what do i supposed to get in return? |
Im not 100% that the curl comman is correct. But something lika that should Do you use GET method in the plugin? Den 16 juli 2016 11:30 skrev "Shlomi Perets" [email protected]: Where do i need to run the curl command (does it matter?) and what do i — Reply to this email directly, view it on GitHub |
@tomasbjerre In my case It is not at all triggering anything from bitbucket. I am using bitbucket 4.7.1 |
When I use this command $ curl -u username:passwd 'http://localhost:7990/bitbucket/rest/prnfb-admin/1.0/settings/notifications' -H 'Accept: application/json, text/javascript, */*; q=0.01' I get response as {"message":"null for uri: http://localhost:7990/rest/api/1.0/bitbucket/rest/prnfb-admin/1.0/settings/notifications","status-code":404}% |
You should open another issue about that. This issue is not about this Den 18 juli 2016 09:03 skrev "Mihir Soni" [email protected]:
|
@tomasbjerre As mentioned , I have created issue #133 |
I rewrote the documentation in the README does that help? It took me a while but I managed to trigger Jenkins 2.2 now! |
Open issue again if any problems. |
Hi! I have the same issue as well. I try to trigger Jenkins job with https://jenkins/job/pull%20request_builder/buildWithParameters?FROM_REPO=${PULL_REQUEST_FROM_REPO_NAME}. I tried both POST and GET, unfortunately the job is triggered but parameters' values are blank and not listed as env variables. Could you help me please? Thank you in advance. |
Hi, I Just download this plugin with Bitbucket 4.7.1 When trying to trasfer parameters to jenkins (2.1) i'm getting nothing. e.g. "The URL to invoke when notification is triggered" - https:///job/eventhubutils_Build_mvn/buildWithParameters?FROM_REPO=${PULL_REQUEST_FROM_REPO_NAME}&TO_REPO=${PULL_REQUEST_TO_REPO_NAME}&PULL_REQUEST_USER_DISPLAY_NAME=${PULL_REQUEST_USER_DISPLAY_NAME}&EVERYTHING_URL=${EVERYTHING_URL} Can you advise?
PS - the 'Build with Parameters' started but all the parameters are blank.
(Bitbucket server is Windows and Jenkins is Linux)
The text was updated successfully, but these errors were encountered: