Chinaunix首页 | 论坛 | 博客
  • 博客访问: 284670
  • 博文数量: 64
  • 博客积分: 3099
  • 博客等级: 中校
  • 技术积分: 615
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-29 19:38
文章分类

全部博文(64)

文章存档

2015年(1)

2014年(7)

2013年(6)

2012年(3)

2010年(11)

2009年(3)

2008年(19)

2007年(14)

我的朋友

分类: LINUX

2015-04-10 18:32:57

这两天打算将项目的编译打包工作交给内网服务器,尝试了使用apt-get install jenkins的方式安装,虽然能够顺利安装成功,但因为其使用的jenkins用户权限调整后总是出问题,于是打算用jenkins.war包来使用。
其实官网有详细的流程,这里转载过来,以备不时之需。

Java Service Wrapper

The is a wrapper that works both on Unix and . It requires some set up but when it is setup it can be used as any other unix service (like start/stop).

This example will install a Jenkins instance in /home/jenkins on a debian machine. The Jenkins configuration is stored in /home/jenkins/data. Jenkins will be running on port 8070 and as the jenkins user.

  1. Select and download a JSW package from the .
  2. Unpack the package into the /home/jenkins path.
  3. Create /home/jenkins/tmp as the temporary directory for JSW.
  4. Download the jenkins.war file into /home/jenkins/lib.
    • If you have plugins that you would like to use, download them into /home/jenkins/data/plugins.
  5. Copy the /home/jenkins/src/conf/wrapper.conf.in to /home/jenkins/conf/wrapper.conf and change the below configuration properties in the file.
    wrapper.java.classpath.1=../lib/jenkins.war
    wrapper.java.classpath.2=../lib/wrapper.jar
    
    wrapper.java.additional.1=-DJENKINS_HOME=../data
    wrapper.java.additional.2=-Djava.io.tmpdir=../tmp
    wrapper.java.additional.3=-server
    
    # Set directly the time zone of the JVM, by setting this we do not rely on the time zone of the server.
    # Uncomment the following line if needed.
    # wrapper.java.additional.4=-Duser.timezone=America/Los_Angeles
    
    wrapper.app.parameter.1=Main
    wrapper.app.parameter.2=--httpPort=8070
    
    wrapper.ping.timeout=300
    wrapper.jvm_exit.timeout=60
    
    wrapper.console.title=Jenkins Continuous build server
    
  6. Verify the wrapper configuration by starting Jenkins through /home/jenkins/bin/testwrapper console. Jenkins should be accessible through , if not check the console output for errors.
  7. Copy the /home/jenkins/src/bin/sh.script.in to /etc/init.d/jenkins and change the below configuration properties in the file.
    APP_NAME="Jenkins"
    APP_LONG_NAME="Jenkins Continuous build server"
    
    WRAPPER_CMD="/home/jenkins/bin/wrapper"
    WRAPPER_CONF="/home/jenkins/conf/wrapper.conf"
    
    PIDDIR="/home/jenkins/bin"
    
    RUN_AS_USER=jenkins
    
  8. Verify installation by starting the daemon through /etc/init.d/jenkins start. Make sure that /etc/init.d/jenkins has the correct permissions; normally 755 is ok for this.
RUN_AS_USER这里可以改成当前用户或者其他,处理好权限问题就好。
阅读(557) | 评论(0) | 转发(0) |
0

上一篇:字符编码常识及问题解析

下一篇:没有了

给主人留下些什么吧!~~