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?
- Go to
Manage Jenkins > Manage Nodes > New Node
. - Configure a node.
- Go to the list of nodes.
- Select your newly configured node. It should be offline at this moment.
- Run the java command displayed on the interface on your host machine.
- 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
Configure Options for Building Mingw-64 on Linux-64 for Linux-64 (Ultimately Targetting Windows-64)
Difference Between --Cap-Add=Net_Admin and Add Capabilities in .Yml
Bash Alias Create File with Current Timestamp in Filename
Rsync --Exclude Not Excluding Specific Files
Extract Text Between Two Strings Repeatedly Using Sed or Awk
How to Manage Log Verbosity Inside a Shell Script
How to Install Valgrind Properly
How to Schedule an R Script Cronjob in a Linux Server
How to Convert a Linux Executable File (Binary) to Windows Exe File
32-Bit Process's Address Space on 64-Bit Linux
Why Does "Uniq" Count Identical Words as Different
Bash Script: Always Show Menu After Loop Execution
How to Prevent Tar from Overwriting an Existing Archive
How to Get No. of Lines Count That Matches a String from All the Files in a Folder