标签:java service file start import
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
yum install jenkins
安装完成后,默认的端口是8080,修改端口/etc/sysconfig/jenkins中的JENKINS_PORT="8086"即可
启动jenkins,service jenkins start
有可能出现错误:“Starting Jenkins -bash: /usr/bin/java: No such file or directory”。表示找不到Jenkins找不到java。
修改 vi /etc/init.d/jenkins 在最后加
candidates="
/etc/alternatives/java
/usr/lib/jvm/java-1.6.0/bin/java
/usr/lib/jvm/jre-1.6.0/bin/java
/usr/lib/jvm/java-1.7.0/bin/java
/usr/lib/jvm/jre-1.7.0/bin/java
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/jre-1.8.0/bin/java
/usr/bin/java
/usr/java/jdk1.7.0_71/bin/java
访问Jenkins:http://*.*.*.*:8086/
通过jenkins发布war包到指定的tomcat服务器
首先修改/usr/java/test-tomcat-7.0.57/conf中的tomcat-users.xml增加<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-jmx"/>
<role rolename="manager-script"/>
<role rolename="manager-status"/>
<user username="admin" password="admin" roles="admin-gui,admin-script,manager-gui,manager-jmx,manager-script,manager-status"/>
/usr/java/apache-maven-3.0.5/conf/setting.xml中增加
<server>
<id>tomcat7</id>
<username>admin</username>
<password>admin</password>
</server>
新建war包的配置
源码管理中选择Subversion
Repository URL:svn://*.*.*.*/admin/app-admin
构建后操作:
WAR/EAR files target/app-admin.war
Containers
Tomcat 7.x
Manager user name:admin
Manager password:admin
Tomcat URL:http://*.*.*.*:8090
在jenkins中的系统设置中设置jdk,maven的路径
访问jenkins:http://121.42.13.124:8086/
发布war的过程中遇到的问题
发布过程中经常报这样的错误org.tmatesoft.svn.core.SVNAuthenticationException: svn: E220001: 条目不可读
原因是/home/svn/admin/conf/svnserve.conf中的anon-access = read没有改成none
内存溢出问题:/usr/java/test-tomcat-7.0.57/bin/catalina.sh中增加JAVA_OPTS=‘-server -Xms1024m -Xmx1536m -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=256m‘
标签:java service file start import
原文地址:http://yaomy.blog.51cto.com/8892139/1627184