Date: 2012.06.19
The intent of this app is to get one up and running with Jenkins, quick and hopefully paninless.
I have used Ubuntu Server on VirtualBox. I have left the Virtual box installation out of scope.
This steps require you to login to the server and su to the jenkins user.
Login to the ubuntu server and execute the code below, instructions from [jenkins-ci.org] (https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu).
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install openjdk-6-jdk git-core #(openjdk does not require registration)
sudo apt-get install jenkins
You need this step if you intend to use autenticated git access.
Copy the folder .ssh containing the files id_rsa and id_rsa.pub(this is the file you upload to the git server) to /var/lib/jenkins/. and execute:
cd /var/lib/jenkins
chown -R jenkins:adm .ssh
chmod -R 700 .ssh
You can now test the connection by changing to the jenkins user and executing the following commands with:
sudo su - jenkins
ssh -T git@github.com
The respons shuld be:
Hi <githubuser>! You've successfully authenticated, but GitHub does not provide shell access.
There is more to the git installation process, this is done after the first build.
- Name: java-6-openjdk
- JAVA_HOME: /usr/lib/jvm/java-6-openjdk/
Git was installed initially using apt-get install.
- Name: default
- Path to Git executable:/usr/bin/git
- Name: default.
- Check: Install automatically.
- Version: 3.0.4 (Make your pick).
//TODO should add a screen-shot here.
- Set jobname: HelloJenkins
- Select: Build a maven2/3 project.
- Set Projectname: HelloJenkins
- Check: Discard Old Builds. I use, Days to keep builds: 2, Max # of builds to keep: 2
- Source Code Management (Select): git
- Repository URL: git@github.com:jensse/HelloJenkins.git
- Repository browser: githubweb, https://github.com/jensse/HelloJenkins
- Build Triggers: Poll SCM, "*/15 * * * *" (every 15 minutes).
- Goals and options: test package
- Run build:
Login to the jenkins server:
sudo su - jenkins
cd ~/jobs/HelloJenkins/workspace
Set git credential information:
git config --global user.email "jenkins@your_url"
git config --global user.name "jenkins ci"
Apperently this is now configurable using the Git plugin section of system configuration.
login and rerun the build process. Hopefully all is sunshine ;-)