1. install jdk or jre
> sudo apt-get update
> sudo apt-get install openjdk-6-jdk
2. install jenkins
> wget http://ftp-nyc.osuosl.org/pub/jenkins/debian/jenkins_1.505_all.deb
> sudo apt-get install daemon
> sudo dpkg -i jenkins_1.505_all.deb
3. install maven/git for project
> sudo apt-get install git unzip
> wget http://ftp.meisei-u.ac.jp/mirror/apache/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.zip
> unzip apache-maven-3.0.5-bin.zip
# add M2_HOME to .bashrc
export M2_HOME=/opt/apache-maven-3.0.4
export PATH=$PATH:$M2_HOME/bin
4. add dns record on dns-server (jenkins.company.com)
5. setting up an Nginx Proxy for port 80 -> 8080
# install nginx
> sudo aptitude -y install nginx
# remove default configuration
> cd /etc/nginx/sites-available
> sudo rm default
# create new configuration for Jenkins
The content of file "jenkins" :
upstream app_server { server 127.0.0.1:8080 fail_timeout=0; } server { listen 80; listen [::]:80 default ipv6only=on; server_name jenkins.company.com; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://app_server; break; } } }
# link your configuration
> sudo ln -s /etc/nginx/sites-available/jenkins /etc/nginx/sites-enabled/
# restart nginx
> sudo service nginx restart
6. add ssh key to git server
> sudo su jenkins
> cd ~/.ssh
> ssh-keygen
copy file "id_rsa.pub" content to git server ".ssh/authorized_keys"
7. access jenkins
http://jenkins.company.com/