07-02-2019 09:14 AM
Hi All.
I working on setting up Jenkins with Github. I'm using NI CLI.
The basic setup is working and I can clone a private repo on Github from Jenkins and do a LabVIEW mass compile e.g.
Now I want to setup this test to automatically start after each commit. This setup is also described in this video:
https://www.youtube.com/watch?v=Z3S2gMBUkBo&t=304s
It's using a webhook - however that requires my Jenkins server to be "visible" outside our office network by using port forwarding.
Basically I just want to ask if this the way to do it - do I need to expose my Jenkins server by opening the port?
Thanks!
Solved! Go to Solution.
07-02-2019 09:28 AM - edited 07-02-2019 09:30 AM
Hi A.E.M
Yeah, you need to have Jenkins on a public IP.
I had this exact issue last week.
I solved it by using ngrok. They offer a free web hosting service (via a TCP tunnel). I haven't had any issues with it and it worked straight away.
There are four really straightforward steps to get started: https://dashboard.ngrok.com/get-started
NB: This can also be solved with port forwarding, however, due to our IT infrastructure, that option was unavailable to me.
07-02-2019 09:32 AM
If you're in some institution with an IT department, they might set up a reverse proxy for you.
Your alternative (considerably less desirable option) is to not use webhooks and instead poll the repository(ies?) This saves you some networking trouble potentially but loads your Jenkins server and delays your builds (with faster polling increasing one and decreasing the other).
07-03-2019 04:20 AM
Thanks for your suggestions!
I really want to avoid polling the repo's, as that doesn't really seems like a viable solution.
The best solution is to get IT involved etc, but currently I'm experienting to collect information to understand what is needed and required. I just wanted to make sure I understood the usage of webhooks correctly, so thanks for verifying.
I just tested with ngrok. That just worked out of the box, with easy configuration. Thanks for pointing me to that solution. That seems to be working just fine. Do you see any performance issues? Are you still using the free plan or do you see any advances in upgrading to a paid plan?
07-03-2019 05:19 AM
I really want to avoid polling the repo's, as that doesn't really seems like a viable solution.
Agreed!
I just tested with ngrok. That just worked out of the box, with easy configuration. Thanks for pointing me to that solution. That seems to be working just fine. Do you see any performance issues? Are you still using the free plan or do you see any advances in upgrading to a paid plan?
I'm still using the free version - the only downside of the free version is that you'll have to create a new forwarding URL if your PC restarts, with the paid version you can reserve URLs I think. For me, this is okay because I'm only working on a few big projects, so it only takes a few minutes to create the URL and update the webhooks.
I haven't noticed any performance issues at all.
I was really pleasantly surprised with now simple ngrok is!
07-03-2019 08:23 AM
Thanks for your input!
07-18-2019 09:18 AM
There is also smee which appeared on the Jenkins blog: https://jenkins.io/blog/2019/01/07/webhook-firewalls/
However I'm currently having issues with it - it seems to be specific to bitbucket though so might be good for Github?
07-18-2019 09:24 AM
I tried using smee for some initial trials and had no problems getting it working - however, as far as I could understand, your link/URL is not in any way protected. Not only can anyone send you anything (this is in principle true with any public facing URL I suppose) but if I know your URL I can read everything you receive via the Web interface or perhaps even by attaching my own client...