Total Pageviews

Wednesday, 1 November 2017

Jenkins

Jenkins automation server

About

In a nutshell, Jenkins is the leading open-source automation server. Built with Java, it provides over 1000 plugins to support automating virtually anything, so that humans can actually spend their time doing things machines cannot.

What to Use Jenkins for and When to Use It

Use Jenkins to automate your development workflow so you can focus on work that matters most. Jenkins is commonly used for:
  • Building projects
  • Running tests to detect bugs and other issues as soon as they are introduced
  • Static code analysis
  • Deployment
Execute repetitive tasks, save time, and optimize your development process with Jenkins.

Downloads

Non-source downloads such as WAR files and several Linux packages can be found on our Mirrors.

Source

Our latest and greatest source of Jenkins can be found on GitHub. Fork us!

Contributing to Jenkins

Follow contributing file.

News and Website

All information about Jenkins can be found on our website. Follow us on Twitter @jenkinsci.

from https://github.com/jenkinsci/jenkins
-----------

安装/配置jenkins

基础环境准备
2.1 设置或关闭防火墙
systemctl disable firewalld.service
2.2 禁用selinux安全
vi /etc/selinux/config
SELINUX=disabled
3、安装配置Java环境
安装包下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (请根据实际情况选择对应的安装包)
3.1安装JDK
本文使用的安装包是:jdk-8u172-linux-x64.tar.gz
wget http://download.Oracle.com/otn-pub/java/jdk/8u172/jdk-8u172-linux-x64.tar.gz
(请替换成安装包下载地址里面具体安装包的对应链接)
tar xzvf jdk-8u172-linux-x64.tar.gz -C /usr/local/
cd /usr/local/
ln -sv jdk1.8.0_172 jdk
3.2 配置环境变量:
vi /etc/profile.d/jdk.sh
—————————————————>
JAVA_HOME=/usr/local/jdk
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
<—————————————————
. /etc/profile.d/jdk.sh //重读此文件,让变量生效
3.3 查看JAVA是否安装成功:
java -version
4、安装Tomcat服务器
4.1 安装包下载地址:http://tomcat.apache.org/download-90.cgi
(请根据实际情况选择对应的安装包)
本文使用的安装包是:apache-tomcat-9.0.8
tar xzvf apache-tomcat-9.0.8.tar.gz -C /usr/local/
cd /usr/local/
ln -sv apache-tomcat-9.0.8 tomcat
4.2 配置环境变量:
vi /etc/profile.d/tomcat.sh
—————————————————>
CATALINA_BASE=/usr/local/tomcat
PATH=$CATALINA_BASE/bin:$PATH
JENKINS_HOME=$CATALINA_BASE/webapps/jenkins
export PATH CATALINA_BASE JENKINS_HOME
<—————————————————
. /etc/profile.d/tomcat.sh
4.3 查看tomcat是否安装成功:
cd /usr/local/tomcat/bin
sh catalina.sh version
4.5 配置server.xml修改默认的8080端口
vi /usr/local/tomcat/conf/server.xml
<Connector port=”8080″ protocol=”HTTP/1.1″
connectionTimeout=”20000″
redirectPort=”8443″ /> 该为8000端口
4.6 tomcat有 manager-gui 的管理页面,想要使用必须配置管理用户,不使用可以跳过此步
vi /usr/local/tomcat/conf/tomcat-users.xml
<role rolename=”manager-gui”/> //指定用户可以使用的接口为manager-gui
<user username=”tomcat” password=”tomcat” roles=”manager-gui”/> //用户名和密码为tomcat,在manager-gui接口使用
5. 安装 Jenkins 到 Tomcat
5.1 下载Jenkins安装包:
wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
mkdir /usr/local/tomcat/webapps/jenkins
cp jenkins.war /usr/local/tomcat/webapps/jenkins
cd /usr/local/tomcat/webapps/jenkins
jar -xvf jenkins.war
5.2. 在 Client 上打开浏览器,访问 http://219.159.152.89:8000/jenkins/ 即可
5.3 获取jenkins登录密码:
cat /webapps/jenkins/secrets/initialAdminPassword
6a3043afc3b643c794d5e84c9d046cc7
管理:manager
密码:HelloJenkins8000
6. 补充安装配置maven
6.1 安装包下载地址:http://maven.apache.org/download.cgi
(请根据实际情况选择对应的安装包)
本文使用的安装包是:apache-maven-3.5.3-bin
tar xzvf apache-maven-3.5.3-bin.tar.gz -C /usr/local/
cd /usr/local/
ln -sv apache-maven-3.5.3-bin maven
6.2 配置环境变量:
vi /etc/profile #编辑系统配置文件
#set Maven environment
export MAVEN_HOME=/usr/local/apache-maven-3.5.3
export PATH=$MAVEN_HOME/bin:$PATH
6.3 重新加载系统配置文件
source /etc/profile
6.4 执行mvn -v查看是否安装完成
7、Jenkins安装Gitlab Hook Plugin插件
--------------
 
相关帖子:
https://briteming.blogspot.com/2014/06/java-jenkins.html
https://briteming.blogspot.com/2016/05/jenkins.html

No comments:

Post a Comment