Webhooks in hosted gitlab + local jenkins setup

18 views
Skip to first unread message

Lorem Ipsum

unread,
Jan 22, 2018, 1:42:45 PM1/22/18
to Jenkins Users
Hello,

I've got a question and a possible answer but since I'm new to Jenkins and it's plugins maybe there is an easier way to do the thing I'm trying to accomplish.

First of my current setup is the following:

- Gitlab hosted on a server
- Jenkins on premise with dynamic IP and hard to open up a port

Since I understood by now that polling is a CI anti-pattern I'd very much like to use webhooks to trigger Jenkins builds but of course I won't be able to set this up with webhook posting to localhost.
So I've thought of posting to an intermediary script (eg. node.js) running on a external server with static IP which would receive all of the webhooks and which Jenkins would be connected to with a client via a socket for example, effectively waiting for incoming data. Upon new data it would trigger new Jenkins job locally, expectedly immediately after the intermediary receives the payload.

I know it's a bit odd way around but opening up a port is a bigger difficulty in my setup than actually deploying the above. Also hosting Jenkins on the mentioned server is not an option for me as I want to run builds and tests on actual hardware in some cases.

So my question would be if maybe there is some already existing solution for this? Initially I've tried with DDNS but it didn't do the job unfortunately.
I've been looking for topics from people with similar experiences but haven't found anything.

Chris Denneen

unread,
Jan 22, 2018, 3:10:45 PM1/22/18
to Jenkins Users
Why didn't DDNS work?

Lorem Ipsum

unread,
Jan 22, 2018, 3:29:19 PM1/22/18
to Jenkins Users
Couldn't forward the ports for inbound traffic

Stephen Connolly

unread,
Jan 22, 2018, 3:56:37 PM1/22/18
to jenkins...@googlegroups.com
Try ngrok. Run it on the Jenkins Server and it will give you a public url for the webhook

On Mon 22 Jan 2018 at 20:29, Lorem Ipsum <utookmy...@gmail.com> wrote:
Couldn't forward the ports for inbound traffic

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3edb5931-a152-4713-ab12-5020028e6ebb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone

Lorem Ipsum

unread,
Jan 22, 2018, 4:39:24 PM1/22/18
to Jenkins Users
Thank you, this is perfect!. Totally forgot about ngrok


Reply all
Reply to author
Forward
0 new messages