Setting Up Jenkins Slave on MAC Os

How to setup a Jenkins slave agent on a Mac to retrieve files using Plastic?

I think the problem could be related to the following Jenkins bug:
https://issues.jenkins-ci.org/browse/JENKINS-17157 (Enviroment variables are not loaded in ssh using cygwin)

If your slave is connecting via SSH to your Jenkins server, the environment variables are lost so you can't run "cm" commands.
The following link may be useful: (https://support.cloudbees.com/hc/en-us/articles/229724088-How-to-set-up-a-Jenkins-agent-to-have-the-same-path-as-the-user-when-connected-via-Remote-Desktop-)

In the past, we tried to connect the slave via "Java Web Start" (not via SSH) and we were not able to reproduce this issue with the lost PATH variable (it's only happening when connecting via SSH).

On the macOS:
- Running:
eg:

sudo java -jar agent.jar -jnlpUrl http://MySERVER84/computer/macOsJava/slave-agent.jnlp -secret f5dcf86e0ceed3f22c08bc27fa07d680aff3e11c25452677af4fee218bcfb1aa -workDir "/tmp"

jenkins slave on mac directory not accessible

So the reason it works for "jenkins" user is because Jenkins creates a Application account with jenkins user which has permissions to run/access Jenkins(and its folders- in your case -workDir "/Users/jenkins/jenkins_slave/"). That is why jenkins can run the command but when you try to run it with sudo it fails.

Why does it fail with sudo ?

That's mainly because there is directory higher in the tree where you do not have execute permission, so even with 777, you will still not be able to run it.

Instead do a chown or usermod on the directory to the user that you wish to get access

sudo usermod -a -G rohit git

for more information https://askubuntu.com/questions/812513/permission-denied-in-777-folder

Jenkins Windows Master to connect to Slave Mac OSX

SSH method requires that an SSH server is running on the target that you try to connect to.

Maybe your Mac does not have SSH server running and/or configured.

Mac Slave - connect to Master on restart

My only issue was to start the launchDaemon during start up. I did not know how to do it. At last i figured it out by creating an executable to launchDaemon and to invoke the exe from /etc/launchd.conf during start up. It works great now.

Jenkins through docker: How to configure own host as agent for jenkins?

  1. Go to Manage Jenkins > Manage Nodes > New Node.
  2. Configure a node.
  3. Go to the list of nodes.
  4. Select your newly configured node. It should be offline at this moment.
  5. Run the java command displayed on the interface on your host machine.
  6. Your Host machine is now a slave.

Unable to connect local slave to Jenkins master on AWS

Setting the property -Dhudson.TcpSlaveAgentListener.hostName in /etc/default/jenkins resolved my problem.



Related Topics



Leave a reply



Submit