简体   繁体   中英

Setting up GitHub webhook with Jenkins on EC2

I have read through almost all of the guides by now on how to set up Jenkins with GitHub, but none of them seem to solve my problem. My job currently builds fine, but I want it to build every time I push to GitHub. I also want to manually set up my hook URLs (not let Jenkins auto-manage them). Currently my Jenkins server is running on EC2 on port 8080 ( http://ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com:8080/ ). The sys admin says the server is set up to listen to all incoming requests on that port.

Under the GitHub Web Hook area of the Configure System area, I have Manually manage hook URLs checked off.

In my project's configuration, I have the following setup:

GitHub Project: https://github.com/username/projectname/
Source Code Management > Git
    Repository URL: git@github.com:username/projectname.git
    Branches to Build - Branch Specifier (blank for default): master
Build Triggers > Build when a change is pushed to GitHub

In the GitHub Hook Log it displays the message:

Last GitHub Push
Polling has not run yet.

I have also created a user with which GitHub can connect. The user has a role with the following global permissions: Overall: Read Job: Read Job: Discover Job: Build

On GitHub, in Settings > Service Hooks I have added https://USERNAME:PASSWORD@ec2-XX-XXX-XXX-XXX.compute-1.amazonaws.com:8080/github-webhook/ , where USERNAME and PASSWORD are the username and password for the GitHub account. I added the link to BOTH the WebHook URLs area and the Jenkins (GitHub plugin) area. When I click Test Hook under former area no message of confirmation shows up on the GitHub page, but when I click Test Hook under the latter it says Payload Deployed. Both, however, are registering in my System log file, and they are generating similar errors:

winstone.WinstoneException: Error URI Line: <Garbled Text Here>

at winstone.HttpListener.parseURILine(HttpListener.java:349)
at winstone.HttpListener.parseURI(HttpListener.java:258)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:83)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
Jun 7, 2013 6:16:31 PM winstone.Logger logInternal
SEVERE: Error within request handler thread

Any ideas about what could be causing this?

If this does not appear in Winstone's access log, and the problem persists without SSL, try nc -l -p 8080 to see what the actual request being sent from GitHub is. (Or try a different servlet container.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM