Java – Jenkins hook does not work – Jenkins bitbucket

Hi, I'm using Jenkins and bitbucket. I want to trigger the construction of Jenkins when I submit anything to the bitbucket repository

In Jenkins

>I created a program called test_ 1's project > in the build trigger section of the configuration section, I checked trigger remote build > I added a token test_ TOKEN

Triggered when I type this in my browser URL and execute a Jenkins build

http://test.com:8080/job/test_1//build?token=TEST_TOKEN

In bitbucket

I added a Jenkins hook

>End point: http://test.com:8080/job/test_1//build?token=TEST_TOKEN >Module name – null > project name – test_ 1 > token - empty

Then submit some code to bitbucket through GIT. The Jenkins build does not run. It seems that the trigger does not run/ How to solve this problem Please help me Thanks in advance:)

Solution

I have the same problem@ Fmitchell was right in his advice on these areas

I use a normal post hook instead of where I provide the entire URL:

http://USER_NAME:USER_TOKEN@YOUR.JENKINS.URL.COM:YOUR_PORT/job/YOUR_PROJECT_NAME/build?token=some_token_from_jenkins

eg: http://bob.miller@jenkins.example.com:8080/job/test_1/build?token=TEST_TOKEN

It seems that bitbuck is missing the last parameter "build" in the URL it creates, but I'm not sure

——Renew——

I found a better solution. You can not only trigger the build, but also build different branches through different Jenkins projects:

>Install bitbucket plugin in Jenkins > Add normal posts as hooks to your bitbucket repository (set – > hooks) and use the following website:

>Configure the Jenkins project as follows:

>When the build trigger is enabled, push the changes to bitbucket > select git under source control; Enter your credentials and define the branch to build (e.g. * * feature / *)

In this way, I have three build projects, one for all functions, one for development and one for publishing branches

Best of all, you don't have to add new hooks for the new Jenkins project

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>