Skip to content

jensse/HelloJenkins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

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.

Innstaling Jenkins on Ubuntu.

This steps require you to login to the server and su to the jenkins user.

Install Jenkins.

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 

Installing ssh private key.

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.

Jenkins configuration

JDK installation

  • Name: java-6-openjdk
  • JAVA_HOME: /usr/lib/jvm/java-6-openjdk/

Git installations

Git was installed initially using apt-get install.

  • Name: default
  • Path to Git executable:/usr/bin/git

Maven installations

  • Name: default.
  • Check: Install automatically.
  • Version: 3.0.4 (Make your pick).

Setting up the automatic build process.

//TODO should add a screen-shot here.

Project in Jenkins

New Job

  • Set jobname: HelloJenkins
  • Select: Build a maven2/3 project.

Configuration settings

  • 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:

After first build (git continued)

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 ;-)

About

Pull a simple Maven project from github and build with Jenkins

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages