linux下jenkins的安装

原创 2018-10-19 18:18 阅读(1063)次

       Jenkins是一个开源软件项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能。用它作为自动构建与自动发布工程是相当方便,我已经体会到它带给程序员快捷发布的快感了,let's do it!

       有两种安装方式,一直是直接下载官网里的war包,丢到tomcat8下直接运行就可以了,还有一种是在linux下用rpm安装,今天主要记录一下linux rpm安装。后面还会分享如何自动发布。

安装:

官网下载rpm安装包,下载地址:https://pkg.jenkins.io/redhat-stable/
rpm -ivh jenkins-2.138.2-1.1.noarch.rpm
安装完后主要目录有:
/etc/sysconfig/jenkins
/var/lib/jenkins
/var/log/jenkins
/var/cache/jenkins
/usr/lib/jenkins

工作目录:/var/lib/jenkins/workspace/
jenkins maven本地仓库:/var/lib/jenkins/.m2/repository

启动:service jenkins start
停止:service jenkins stop


访问:http://192.168.87.130:8080/,第一次登录需要初始化密码,可以在jenkins启动日志中看到:
cat /var/log/jenkins/jenkins.log或者cat /var/lib/jenkins/secrets/initialAdminPassword


Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:


593ae33a2505493bb2e8c59030514f80


This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword


登录后可以点admin名后的设置修改密码:admin admin123