I am running my jenkins on localhost on my macmini which is my remote machine. All the tests are also running on that mac mini. However i want to share that localhost:8080 jenkins url to make it publickly so something like the eg.71.65.187.98:8080. so within the same network my coworkers can open the url and see the jenkins. How can i do that? without using any external service?
Run ifconfig
in the terminal. it'll show all the network interfaces on your Mac. One of them is the network your machine is actively connected to.
If your Mac is on a wired connection that should be en0
. Make a note of the address after inet
, that should be the address your machine uses
-
i got it but do i need to add that IP in the jenkins setting? Because i tried to access the IPaddress:8080 and it is not found – testautomation Oct 13 '20 at 16:06
It depends on how you start your jenkins server. If you use the generic war file then you can add the command flags --httpPort=yourPort --httpListenAddress=yourAdress
.
A complete command could look like this:
java "${JAVA_OPTS}" -Xms256m -Xmx256m -jar jenkins.war --httpPort=8787 --httpListenAddress=192.168.0.171
Depending on your OS it may be possible that you need to tell your firewall to open the desired port.
-
not sure if it will work i start my jenkins using - brew services start jenkins-lts – testautomation Oct 13 '20 at 18:58
-
In case you installed Jenkins via and package manager it is very likely that you have a global config file wäre you can set the desired value for
httpListenAddress
. According to this blog post it could be/usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.plist
macminivault.com/installing-jenkins-on-macos – Krischa Onarestlessday Oct 13 '20 at 19:30
I was able to solve the issue since i installed my jenkins using brew. first I needed to :
nano /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.plist
then change the httpListenAddress to
0.0.0.0
Then by using ifconfig on the terminal i was able to get my IP address and i was able the use
IP address:8080
inside my network.