rhwood / jenkins-slave-osx Goto Github PK
View Code? Open in Web Editor NEWJenkins JNLP slave service for modern OS X systems
License: MIT License
Jenkins JNLP slave service for modern OS X systems
License: MIT License
I get this output when running the script. If it's harmless, please modify the script to avoid the warnings (e.g. check if a file exists before running chmod
on it). If the warnings are not harmless, let's debug them further.
API token for builds: ABC
security: SecKeychainCreate login.keychain: A keychain with the same name already exists.
/dev/fd/63: line 261: /Users/builds/Library/Keychains/.keychain_pass: Permission denied
chmod: /Users/builds/Library/Keychains/.keychain_pass: No such file or directory
In slave.jnlp.sh, we default to setting JAVA_ARGS=-Djava.awt.headless=true"
, however this setting needs to be more rigorously enforced, as an empty set of JAVA_ARGS in ${JENKINS_HOME}/Library/Preferences/org.jenkins-ci.slave.jnlp.conf will overwrite the headless arguments. We should prepend that argument to the default JAVA_ARGS created by the installer instead.
The installer should, if possible, test that the slave it is running on is defined as a node in the Jenkins master. This would prevent an issue observed in #34.
Same symptoms as reported in https://issues.jenkins-ci.org/browse/JENKINS-13600
Repeating the curl command that fails I get the following from the remote server:
" Unexpected authentication type: org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1925e221: Username: mr-c; Password: [PROTECTED]; Authenticated: false; Details: org.acegisecurity.ui.WebAuthenticationDetails@ffff8868: RemoteIpAddress: nn.nn.nn.nn; SessionId: null; Not granted any authorities"
[RemoteIpAddress removed]
I invoked:
export SERVICE_USER=builds
bash <( curl -L https://raw.github.com/rhwood/jenkins-slave-osx/master/install.sh ) --user=builds --master=http://myhost/builds/ --node="MacOS X 10.8"
from user account "cowwoc". The installation completed successfully, but then when I opened org.jenkins-ci.slave.jnlp.log
I got:
Getting slave.jar from http://jenkins
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: jenkins
In other words, the URL of the master node is wrong. What is weird is that /var/lib/builds/Library/Preferences/org.jenkins-ci.slave.jnlp.conf
contained the following lines:
JENKINS_SLAVE="MacOS"
JENKINS_MASTER=http://myhost/builds/
HTTP_PORT=
JENKINS_USER=builds
JAVA_ARGS=" -Djava.awt.headless=true"
In other words, this looks correct. I dug further and discovered that /Library/LaunchDaemons/org.jenkins-ci.slave.jnlp.plist
launches /Users/builds/slave.jnlp.sh
. What is interesting is that JENKINS_CONF
inside slave.jnlp.sh
is resolving to /Users/builds/Library/Preferences/org.jenkins-ci.slave.jnlp.conf
(which does not exist) instead of /var/lib/builds/Library/Preferences/org.jenkins-ci.slave.jnlp.conf
(which does exist).
I'm not sure what is the "correct" way to solve this.
Hi!
you probably should consider to add -L flag to any call of curl in your script. Because, otherwise, with system-curl it will not download anything.
So script as-is working perfect with brew version of curl.
The script outputs:
The OS X Keychain password for builds is ABC
You will need to copy this into the Jenkins configuration on bbs
for every project that will be compiled on this slave, or copy a special
per-project Keychain to /Users/builds/Library/Keychains.
I have no idea what this means. It's not clear where I need to enter the keychain password in Jenkins. Please document the steps (which menus to go into) and possibly even include screenshots.
While running install.sh I see the following error and login failures in console. Any suggestions?
/var/lib/jenkins/security.sh: line 79: 9281 Segmentation fault security add-generic-password -U -w ${PASSWORD} -a ${ACCOUNT} -s ${SERVICE} ${OSX_KEYCHAIN}
find-generic-password: illegal option -- w
Usage: find-generic-password [-a account] [-s service] [options...] [-g] [keychain...]
-a Match "account" string
-c Match "creator" (four-character code)
-C Match "type" (four-character code)
-D Match "kind" string
-G Match "value" string (generic attribute)
-j Match "comment" string
-l Match "label" string
-s Match "service" string
-g Display the password for the item found
If no keychains are specified to search, the default search list is used.
Find a generic password item.
/var/lib/jenkins/security.sh: line 79: 9295 Segmentation fault security add-generic-password -U -w ${PASSWORD} -a ${ACCOUNT} -s ${SERVICE} ${OSX_KEYCHAIN}
Jenkins must run as an Agent (instead of a Daemon) if you need to run the iOS simulator. See http://9elements.com/io/index.php/continuous-integration-of-ios-projects-using-jenkins-cocoapods-and-kiwi/ for an explanation.
Please add a command-line option to install the service as an Agent.
How do you cleanly uninstall after installing?
Need to get to point where adding certificates to build iOS apps is documented and, ideally, assisted by the installer.
I am not sure but I think there are closing " missing in security.sh line 127.
"During the configuration, you will be prompted for nessessary information." is supposed to read "...necessary information."
If the node name contain spaces and is passed to the script using quotes, escape characters or %20 everything will proceed normally except that the configuration will not contain the correct value for the node name. It will truncate it after the first space.
I ran through the install script, specifying the URL to my Jenkins master (which is NOT http://jenkins). However, when I try to run the service, the log shows that it is trying to connect to the default jenkins url:
Starting at Wed Feb 19 16:24:42 EST 2014
Getting slave.jar from http://jenkins
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: jenkins
Failing to obtain http://my.jenkins.server.com/computer/opsbibackupsac/slave-agent.jnlp
java.io.IOException: Failed to load http://my.jenkins.server.com/computer/opsbibackupsac/slave-agent.jnlp: 401 Authorization Required
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:236)
at hudson.remoting.Launcher.run(Launcher.java:198)
at hudson.remoting.Launcher.main(Launcher.java:171)
Waiting 10 seconds before retry
Having an issue where the script won't authenticate to pull down the slave-agent.
We are using Jenkins 1.499. I have already implemented the fix outlined in Issue #34.
Just a quick help in the right direction would be great. Thanks.
In four places the installer assumes that the service account group is the same as the service account name. This is not necessarily the case (see #12). The installer needs to populate a variable for the group from the output of dscl /Local/Default search /Groups gid $( dscl /Local/Default read /Users/${SERVICE_USER} PrimaryGroupID | awk '{ print $2 }' ) | head -n1 | awk '{ print $1 }'
and use that value for the group name instead.
Currently the code only creates the Jenkins user account and group if the user account does not exist. This fails to handle the case where the user account exists but the group does not.
Hi there,
I have just tried to install this on macOS Sierra and noticed that security.sh is not compatible and does not store the token.
The following check fails (the file is now called *-db)
....
if [ ! -f ~/Library/Keychains/${OSX_KEYCHAIN}]; then
....
The other thing I noticed is that the ssh keys are not generated.
With the latest changes starting the daemon fails with:
Unable to use expected workspace: /var/lib/jenkins/Library/Developer/org.jenkins-ci.slave.jnlp/Library/Developer/org.jenkins-ci.slave.jnlp
${JENKINS_WRKSPC} seems to contain parts of the correct path twice?
I had to run the installer a few times before I got everything working. Each time I ran it, the output tells me the keystore passphrase the installer created for user 'jenkins'. However, I found out that the latest one is not the correct one, and I had to use the passphrase generated during my first run of the install script.
Some parameters, such as --master
take URLs. If the URL ends with a slash and the script appends other components to it, the URL does not resolve properly.
The script should be smart enough to strip the trailing slash when necessary.
This may be related to #38 - on a freshly unboxed system the script fails with the following:
Installing files...
sed: /var/lib/jenkins/Library/Developer/org.jenkins-ci.slave.jnlp/org.jenkins-ci.slave.jnlp.plist: No such file or directory
sed: /var/lib/jenkins/Library/Developer/org.jenkins-ci.slave.jnlp/org.jenkins-ci.slave.jnlp.plist: No such file or directory
install: /var/lib/jenkins/Library/Developer/org.jenkins-ci.slave.jnlp/org.jenkins-ci.slave.jnlp.plist: No such file or directory
chmod: /var/lib/jenkins/Library/Developer/org.jenkins-ci.slave.jnlp/slave.jnlp.sh: No such file or directory
chmod: /var/lib/jenkins/Library/Developer/org.jenkins-ci.slave.jnlp/security.sh: No such file or directory
and later
launchctl: Couldn't stat("/Library/LaunchDaemons/org.jenkins-ci.slave.jnlp.plist"): No such file or directory
nothing found to load
Is it a problem running this script against Java 8? Do we have to setup something else before running?
sudo -i -u ${SERVICE_USER} ${SERVICE_HOME}/security.sh set-password —password=${SLAVE_TOKEN} —account=${MASTER_USER} —service=\"`rawurlencode "${SLAVE_NODE}"`\"
the command fails with security: SecKeychainUnlock login.keychain: The user name or passphrase you entered is not correct.
and pops up a dialog asking me to enter the password.
It's not clear why the script expects the password to be equal to ${SLAVE_TOKEN}
which actually corresponds to the Slave's API token on the Jenkins master node (no relation to what is going on on the slave). Any ideas?
2.. Later on, the code executes:
sudo -i -u ${SERVICE_USER} ${SERVICE_HOME}/security.sh set-password --password=${KEYSTORE_PASS} --account=${SERVICE_USER} --service=java_truststore
The same thing occurs: wrong password, followed by a pop up asking me to enter the password, but all of a sudden I am asked to change the password for keychain "Local Items". Why am I being asked to do this?
Not only should the use of SSH keys be documented, we should probably document explicitly how to use SSH keys with GitHub, probably in the project Wiki.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.