Hot answers tagged

30

Set the "Restrict where this job can be run" check box in your job configuration and specify the name of your slave. If you add more slaves later, you can set labels for each slave and specify those in your job configs.


19

I couldn't find a built in tool so I made one: #!/usr/bin/python # # author: ajs # license: bsd # copyright: re2 import json import sys import urllib2 jenkinsUrl = "https://jenkins.example.com/job/" if len( sys.argv ) > 1 : jobName = sys.argv[1] else : sys.exit(1) try: jenkinsStream = urllib2.urlopen( jenkinsUrl + jobName + "/...


17

Just in case you're using Nginx and not Apache, you might want to use proxy_redirect http:// https://; to rewrite the Location header as the response comes back from Jenkins. A complete nginx setup where SSL is terminated with Nginx and proxied internally to Jenkins using 8080 might look like this: upstream jenkins { server 127.0.0.1:8080 fail_timeout=0; ...


17

Jenkins kills all process spawn by the job. This can be disabled by setting the BUILD_ID environment variable to something else: export BUILD_ID=dontKillMe see https://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller for details


15

Debian If you installed Jenkins from the Debian package, you can modify /etc/default/jenkins and add the following line somewhere: HTTP_HOST=127.0.0.1 and then add --httpListenAddress=$HTTP_HOST to the JENKINS_ARGS so that it reads something like: JENKINS_ARGS="--webroot=/var/run/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --...


11

This page should help you set it up behind Apache (which would handle HTTPS): http://wiki.hudson-ci.org/display/HUDSON/Running+Hudson+behind+Apache Apart from being a "normal" reverse-proxy, you'll need this (as shown on that page): Header edit Location ^http://www.example.com/hudson/ https://www.example.com/hudson/


9

Note that (as of sometime?) Jenkins can generate the key for you, all you need to do is set the --httpsPort=(portnum) parameter in JENKINS_ARGS. In my case I set JENKINS_PORT="-1" (disable http) and set --httpsPort=8080 which worked well for my own purposes. Just note that any port below 1000 generally requires root access, so pick a port higher than that.....


9

You need to pass in your required value of user.timezone as a JVM argument when you start Jenkins. The Java command line will look something like: $JAVA_HOME/java -Duser.timezone="America/Toronto" [other JVM parameters] $JENKINS_HOME/jenkins.jar Unfortunately I'm not familiar with the Debian installation, but the JVM parameters should either be defined ...


9

OK, so I've managed to do it: you need Role Strategy Plugin enable this authentication strategy in Configure Global Security in Manage and Assign Roles / Manage Roles create new role anonymous and authenticated for both global and project roles in Global roles grant anonymous role right only to Overall / Read (this will at the very least access anonymous ...


9

Configure it to run on any port you like! 81. 8081. Anything really.


8

By default sudo cannot be used without a TTY. In order to do so: Disable 'requiretty' in sudoers (using visudo) This should amount to commenting out 'Defaults requiretty' (using visudo) Ensure that your user is able to login without entering a password: Set 'NOPASSWD' in sudoers Create the user if the user does not exist Set visiblepw - this will allow ...


8

edit the config.xml and replace the following two xml tags with the below version. Then restart your server. <authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/> <securityRealm class="hudson.security.SecurityRealm$None"/> Beware, your existing tags are probably spanning over several lines each.


8

You are getting this error because you enabled the security but don't have any user with permissions. To solve this problem, first edit config.xml and set useSecurity to false I assume that you want to use local authentication (a local db of users) rather than an external db (i.e., LDAP). Follow the steps below taken from Jenkins Documentation. 1. Go to ...


7

Hudson/Jenkins doesn't quite work that way. It stores configurations and job information in /var/lib/jenkins by default (if you're using the .deb package). If you want to setup persistence for a specific application, that's something you'll want to handle yourself - Hudson is a continuous integration server, not a test framework. Check out the Wiki ...


7

Orien is correct, it is the fork() system call triggered by ProcessBuilder or Runtime.exec or other means of the JVM executing an external process (e.g. another JVM running ant, a git command, etc.). There have been some posts on the Jenkins mailing lists about this: Cannot run program "git" ... error=12, Cannot allocate memory There is a nice description ...


7

A more suitable way to achieve the same thing would be to run: # sudo -u jenkins ssh-keygen That will generate the key for you here: /var/lib/jenkins/.ssh/id_rsa.pub


7

Have you set up correct path to git executable in your Jenkins installation? If not, go to Manage Jenkins > Configure System -> Git.


6

Check to see if a build is running or not I tried the Python script in the answer to this question, but couldn't get it to work. I don't know Python, and didn't want to invest any time in debugging, but was able to read enough of the script to gain inspiration from it. All I need to do is check to see if a build is running or not. To do that I used curl ...


6

The one issue that I see with your config is that: ProxyPassReverse / https://jenkins.example.com Should be: ProxyPassReverse / https://jenkins.example.com/ Seems like the service is sending http:// instead of https:// location headers (probably because your connection to its listener from Apache is unencrypted on the localhost listener), in ...


6

You can use any jdk (1.5+ 1.7+ for 1.608+) you want for Jenkins: this is separate from the JDK that a job would use (either a job running on the master, or on a slave). So it doesn't really matter: using one JDK for running Jenkins won't prevent you to use any other JDK for your jobs. Update 2015: Jenkins just said good by to JDK6 (2015-04-06) About ...


6

I am late but In future this will help to other people insted of https://username@bitbucket.org/username/repo.git replace this https://bitbucket.org/username/repo.git in the Git Repository URL


6

I believe you will need a PrivateKeyEntry. You may have generated the CSR with open SSL instead of keytool. You can try: openssl pkcs12 -inkey /var/lib/jenkins/jenkins.key.pem -in /var/lib/jenkins/jenkins.crt.pem -export -out keys.pkcs12 keytool -importkeystore -srckeystore keys.pkcs12 -srcstoretype pkcs12 -destkeystore jenkins.jks See this for a ...


5

It turns out the crutial info seems to be wget's "--auth-no-challenge" option which apparently is for obscure webserver configurations like Jenkins that don't follow expected protocol: wget --auth-no-challenge --user=joe.shmoe --password=secret \ --post-file=config.xml --no-check-certificate \ https://jenkins.company.com/job/myProject/...


5

A former colleague of mine wrote this: https://github.com/txels/autojenkins which has a whole bunch of convenience features and API type stuff around working with a jenkins instance from Python..


5

I ran into this issue which was resolved by editing jenkins config file sudo vim /etc/default/jenkins edit HTTP_HOST, default 127.0.0.1 to HTTP_HOST=0.0.0.0


5

there is also another page "/whoAmI", but I think has the same information which may not help - psftw (#jenkins on freenode)


5

CentOS 6 (I'm just going to assume version 6 here) is shipping git version 1.7.1. The --local switch was introduced with version 1.7.4. Therefore it is not available in the version you are using.


5

Check if you have install git on the Jenkins server, and check if you have set the git executable path in the Jenkins configuration


5

This page on wiki Jenkins mentioned that as per July 2014, the recommended configuration for Jenkins reverse proxy. The missing parameter is RequestHeader set X-Forwarded-Proto "https" and RequestHeader set X-Forwarded-Port "443" So the configuration became <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/certs/cert.pem ...


5

authentication works via ssh. have you added the public ssh-key of the jenkins user to the git-user on your git-server? let me know if you need instructions on how to set up ssh-authentication and i'll edit this post here. /EDIT: glad you got it running. i looked on the official jenkins website for a detailed manual on the ssh part of the configuration, ...



Only top voted, non community-wiki answers of a minimum length are eligible