Pedro Paulo Amorim
Pedro Paulo Amorim

Reputation: 1949

Github Pull Request is not triggering TeamCity

My TeamCity CI has the plugin GitHub Commit Hooks provided by Jetbrains to detect new pull requests and trigger a run. I've installed this plugin and configured it clicking here:

Install GitHub webhook

After that, the web hook is created on GitHub but the address is 0000:8111 which is wrong. So I change to the correct DNS and redeliver the request.

It seems to work, the server returns 202 with the message Scheduled checking for changes for 2 VCS roots. (Server time: 20180615T122359.142+0100) but the trigger is not working.

After a while another problem happens, the server starts rejecting the requests and GitHub returns this:

No stored auth data (secret key) found for public key "72WE45221-19fe-433b-9265-66b2168EW6c". Seems hook created not by this TeamCity server. Reinstall hook via TeamCity UI.

Environment:

What I can do to solve this issue? Is there any issue with my DNS?

EDIT 1:

Now I am able to trigger the build by commits and solved the secret key issue. But pull requests are not triggering the CI.

To solve the secret key issue, you need to change the Server URL on Global Settings.

Upvotes: 1

Views: 4359

Answers (2)

azernik
azernik

Reputation: 1228

I had a similar issue; the solution is to change the TC installation's settings so it's aware of its correct URL, and then re-adding the webhook through the plugin. The setting in question is Administration > Server Administration > Global Settings > Server Url:

enter image description here

Upvotes: 0

kdtong
kdtong

Reputation: 184

A bit of a workaround, but have you tried using a VCS trigger to detect and build pull requests rather than a commit hook? This works the same as any other VCS check in trigger, so if your current configuration is already detecting VCS changes from Github it should be more straightforward to setup.

Pull requests on Github are automatically referenced using the following pattern +:refs/pull/*/head so with a VCS branch specification you can have a TeamCity build project that's dedicated to building pull requests.

See https://blog.jetbrains.com/teamcity/2013/02/automatically-building-pull-requests-from-github-with-teamcity/

Upvotes: 1

Related Questions