Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
ziggystar
@ziggystar
Hello! Do I still need the Gitbucket plugin in Jenkins, or should I only use Github plugin?
Xian Boullosa
@Sherpard
ATM, I use github enterprise plug-in
and it mostly works as expected
ziggystar
@ziggystar
Can Jenkins create the hooks in Gitbucket? I cannot find an entry on the API page of Gitbucket that says CreateHook.
Xian Boullosa
@Sherpard
nope, that doesn't work
you have to manually set it
but you can do that at organization level
and It's fairly straight forward
a webhook
ziggystar
@ziggystar
Ok, thanks. I'm still struggling with that. Trying with a fresh GitBucket installation now.
Xian Boullosa
@Sherpard
BTW
do not forget to setup the secret
ziggystar
@ziggystar
Yes, I did this at least ten times now.
Xian Boullosa
@Sherpard
but overall, you have to setup a webhook to http(s)://jenkinsinstance/github-webhook/
having the right plug-in and so on
ziggystar
@ziggystar
I have both Github and Github Enterprise plugin installed. Might this be the problem?
Xian Boullosa
@Sherpard
afaik that's not an issue, I got both too
In fact, I bet the only one needed is the github plugin
ziggystar
@ziggystar
How do I generate the token. A token on Jenkins for my Jenkins user?
So I go to Jenkins, on my user page I generate an API token, and then I paste this token into the WebHook config on Gitbucket?
Xian Boullosa
@Sherpard
nope,
Jenkins>Configuration>Github>Credentials>Advanced
Shared Secret
there you should configure a random string, that you should use on Gitbucket
ziggystar
@ziggystar
So I have to enter into the hook config the same credentials I enter for the global GH plugin config on Jenkins? Ok, I would have never guessed this. I'll try.
Xian Boullosa
@Sherpard
yep, that's a Shared secret, not a credential
any payload that arrives without that, will be ignored
ziggystar
@ziggystar
Argh, it's behind that advanced button. I've never looked there.
Now I can find in the Jenkins logs: Could not match URL http://mygitbucket-domain/api/v3/repos/tg/test, this also doesn't work, and it looks incorrect.
So the hook now gets through.
But it doesn't match.
Xian Boullosa
@Sherpard
that's an improvement :)
ziggystar
@ziggystar
Definately. :)
The api/v3 part looks off.
Xian Boullosa
@Sherpard
that's ok
on my API URL, i got http://gitbucket/api/v3
so seems to be OK
that seems to be looking for a repository hosted by a user/org called tg and a repo test
ziggystar
@ziggystar
I have this repo set up multiple times in Jenkins now.
Checkout from Gitbucket and branch scanning work.
Xian Boullosa
@Sherpard
I would suggest to create a new job at jenkins
new item > Github Organization
ziggystar
@ziggystar
Yes, I didn't do this, just multi branch pipeline.
Xian Boullosa
@Sherpard
go for a github organization, simplifies it quite a bit
you can build a multi-pipeline too but I'm not proficient with those :(
ziggystar
@ziggystar
I'm also receiving hooks from my other gitbucket installation, and these look like this (but they are for the wrong repository, wierdly: http://gitbucket1/git/Groupname/RepoThatDidNotReceiveACommit.git, and from the new instance I get http://gitbucket2/api/v3/repos/Group/CorrectRepo also note the missing trailing .git.
I think I should try to get a clean Jenkins and a clean GitBucket and start everything from scratch. I once got everything working. But it really took much work to get there.
ziggystar
@ziggystar
Now it's working. I think I did not change to Content-Type: Application/JSON on the webhook config. That's the problem when you try to fix something and start to change all the options you find, because you have no idea why it is not working.
The shared secret config option was the main thing I was missing, I think. Thank you very much, @Sherpard.
Xian Boullosa
@Sherpard
Glad I could help @ziggystar