Webhooks in hosted gitlab + local jenkins setup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Webhooks in hosted gitlab + local jenkins setup

Lorem Ipsum
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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/75b88d8e-fdd4-4f21-a154-d4ce5e4e5d79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Webhooks in hosted gitlab + local jenkins setup

Chris Denneen
Why didn't DDNS work?

On Monday, January 22, 2018 at 1:42:45 PM UTC-5, Lorem Ipsum wrote:
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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5b943dde-296f-49c1-93aa-987d3dc37091%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Webhooks in hosted gitlab + local jenkins setup

Lorem Ipsum
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Webhooks in hosted gitlab + local jenkins setup

stephenconnolly
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 <[hidden email]> 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 [hidden email].
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BnPnMx9U9o72u5vhuL78MgAy%2BHDO2BG%3DmsGS1Q9rZj4B1k%2Bpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Webhooks in hosted gitlab + local jenkins setup

Lorem Ipsum
Thank you, this is perfect!. Totally forgot about ngrok


--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/91fa2624-7585-4f9a-b5dc-2b2f22461981%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.