How to set up CI System by Jenkins +Maven+Sonar with git,
How to set up CI System by Jenkins +Maven+Sonar with git,
Linux OS is CentOS5.8 and Ubuntu11.1
step 0:remove openJDK from yum
#rpm -qa | grep java
#rpm -qa | grep java
#yum -y remove java tzdata-java-2012b-3.el5
#yum -y remove java java-1.6.0-openjdk-1.6.0.0-1.25.1.10.6.el5_8
step 1: install sun java JDK on Linux
#cd /opt/
#wget
http://download.oracle.com/otn-pub/java/jdk/6u32-b05/jdk-6u32-linux-x64.bin
#chomd +x jdk-6u32-linux-x64.bin
#./jdk-6u32-linux-x64.bin
#cd jdk1.6.0_32/
#
#vi /etc/profile
**************************************************************************
JAVA_HOME=/opt/jdk1.6.0_32
JRE_HOME=/opt/jdk1.6.0_32/jre/
PATH=$PATH:$JAVA_HOME/bin:JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:
export JAVA_HOME JRE_HOME PATH CLASSPATH
export M2_HOME=/opt/apache-maven-3.0.4
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$M2:$PATH
export JAVA_HOME=/opt/jdk1.6.0_32
**************************************************************************
#source /etc/profile
#java -version
step 2:install apache-tomcat
#cd /opt/
#wget
http://labs.mop.com/apache-mirror/tomcat/tomcat-7/v7.0.27/bin/apache-tomcat-7.0.27.tar.gz
#chomd +x apache-tomcat-7.0.27.tar.gz
#tar -zxvf apache-tomcat-7.0.27.tar.gz
step 3:install jenkins
# wget -O /etc/yum.repos.d/jenkins.repo \
http://jenkins-ci.org/redhat/jenkins.repo
#sudo wget -O /etc/yum.repos.d/jenkins.repo
http://jenkins-ci.org/redhat/jenkins.repo
#rpm --import
http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
#yum install jenkins
#cd /usr/lib/jenkins/
#cp /usr/lib/jenkins/jenkins.war /opt/apache-tomcat-7.0.27/webapps/
#vi /etc/profile
#/opt/apache-tomcat-7.0.27/bin/startup.sh
#cat /etc/sysconfig/jenkins
#ls /root/.jenkins/
step 4 :install Mysql
#yum install mysql mysql-server
#chkconfig --levels 235 mysqld on
#/etc/init.d/mysqld start
#mysql_secure_installation
# ls /var/lib/jenkins/
#mysql -u root -p
***add database access user for sonar***
#vi /opt/sonar-3.0/conf/sonar.properties
step 5: install git
#rpm -Uvh
http://repo.webtatic.com/yum/centos/5/latest.rpm
#yum install --enablerepo=webtatic git-all
# rpm -qa | grep subversion
#yum -y remove subversion subversion-1.6.11-7.el5_6.4
#yum install --enablerepo=webtatic git-all
#git --version
step 6:install sonar
# unzip sonar-3.0.zip
#cd sonar-3.0
#cd conf/
#vi sonar.properties
#cd sonar-3.0
#cd bin/
#cd linux-x86-64/
#./sonar.sh start
step 7 :install maven
#wget http://apache.crihan.fr/dist//maven/binaries/apache-maven-3.0.4-bin.zip
#tar zxvf apache-maven-3.0.4-bin.tar.gz
# vi /etc/profile
#source /etc/profile
#cd apache-maven-3.0.4
#source /etc/profile
#vi /opt/apache-maven-3.0.4/conf/settings.xml
--------------------------------------
171 vi /opt/apache-tomcat-7.0.27-jenkins/conf/server.xml
*********************************************************
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8" />
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
*********************************************************
394 vi /opt/sonar-3.0/conf/sonar.properties
************************************************************************
#---------------------------------------------------------
# WEB SETTINGS - STANDALONE MODE ONLY
# These settings are ignored when the war file is deployed to a JEE server.
#---------------------------------------------------------
# Listen host/port and context path (for example / or /sonar). Default values are 0.0.0.0:9000/.
sonar.web.host: 192.168.115.129
sonar.web.port: 9000
sonar.web.context: /
#----- Credentials
# Permissions to create tables and indexes must be granted to JDBC user.
# The schema must be created first.
sonar.jdbc.username: sonar***
sonar.jdbc.password: sonar***
#----- MySQL 5.x/6.x
# Comment the embedded database and uncomment the following line to use MySQL
sonar.jdbc.url: jdbc:mysql://192.168.115.129:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
# Optional properties
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver
sonar.jdbc.validationQuery: select 1
******************************************************************
652 vi /opt/apache-maven-3.0.4/conf/settings.xml
******************************************************************
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.jdbc.url>
jdbc:mysql://192.168.115.129:3306/sonar?useUnicode=true&characterEncoding=utf-8
</sonar.jdbc.url>
<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>sonar123</sonar.jdbc.username>
<sonar.jdbc.password>sonar098</sonar.jdbc.password>
<sonar.host.url>http://192.168.115.129:9000</sonar.host.url>
</properties>
</profile>
******************************************************************
step 8 :install SDK on Ubuntu
Ubuntu Linux
Downloading the SDK Starter Package
cd /home/tcl/apps
weget
http://dl.google.com/android/android-sdk_r18-linux.tgz
or scp localhost /opt/android-sdk_r18-linux.tgz tcl@108.166.67.30:/home/tcl/apps/
tar -zxvf android-sdk_r18-linux.tgz
cd /android-sdk_r18-linux/tools/
./android update sdk -u --no-ui
https://help.ubuntu.com/community/Java
https://help.ubuntu.com/community/JavaInstallation
If you are running a 64-bit distribution on your development machine, you need to install the
ia32-libs package using apt-get::
apt-get install ia32-libs
相关文章
- 暂无相关文章
用户点评