设为首页 收藏本站
查看: 1200|回复: 0

[经验分享] 在Ubuntu12下安装配置Jenkins

[复制链接]

尚未签到

发表于 2015-12-13 10:59:24 | 显示全部楼层 |阅读模式
这两天打算将项目的编译打包工作交给内网服务器,尝试了使用apt-get install jenkins的方式安装,虽然能够顺利安装成功,但因为其使用的jenkins用户权限调整后总是出问题,于是打算用jenkins.war包来使用。
其实官网有详细的流程,这里转载过来,以备不时之需。
Java Service Wrapper
  The The Java Service wrapper is a wrapper that works both on Unix and Windows. 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.

  • Select and download a JSW package from the JSW wrapper download page.
  • Unpack the package into the /home/jenkins path.
  • Create /home/jenkins/tmp as the temporary directory for JSW.
  • 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.

  • 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
  • Verify the wrapper configuration by starting Jenkins through /home/jenkins/bin/testwrapper console. Jenkins should be accessible through http://localhost:8070, if not check the console output for errors.
  • 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
  • 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这里可以改成当前用户或者其他,处理好权限问题就好。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-150409-1-1.html 上篇帖子: 这些年我们一起搞过的持续集成~Jenkins+Perl and Shell script 下篇帖子: jenkins script call docker
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表