Jenkins安装部署


  1. 安装java

    1. yum -y list java*

    2. yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel

  2. 安装ant

    1. 查看当前可用版本 http://ant.apache.org/bindownload.cgi

    2. 下载 .tar.gz archive wget http://mirrors.hust.edu.cn/apache//ant/binaries/apache-ant-1.9.7-bin.tar.gz

    3. tar -zxvf apache-ant-1.9.7

    4. mv apache-ant-1.9.7 /usr/local/ant

    5. echo "export PATH=${PATH}:/usr/local/ant/bin" >> /etc/profile

    6. source /etc/profile

  3. 安装maven

    1. 查看当前可用版本 http://maven.apache.org/download.cgi

    2. 下载Binary tar.gz archive wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

    3. tar -zxvf apache-maven-3.3.9-bin.tar.gz

    4. mv apache-maven-3.3.9 /usr/local/maven

    5. echo "export PATH=${PATH}:/usr/local/maven/bin" >> /etc/profile

    6. source /etc/profile

  4. 安装phing(如果选择使用phing来构建php项目)

    1. pear channel-discover pear.phing.info

    2. pear install --alldeps phing/phing

安装配置jenkins http://pkg.jenkins-ci.org/redhat/

  1. 导入jenkins rpm

    1. sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.5epo

    2. sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

  2. 安装 yum install jenkins

  3. 配置jenkins

    1. JENKINS_HOME 指定jenkins工作目录

    2. JENKINS_PORT 指定监听端口

    3. JENKINS_LISTEN_ADDRESS 监听地址

    1. vim /etc/sysconfig/jenkins

  4. 启动jenkins

    1. service jenkins start/restart/stop

  5. 初始化jenkins

    1. 通过配置的地址访问jenkins,等待初始化完成

    2. 原始密码 vim ${JENKINS_HOME}/secrets/initialAdminPassword

    3. 使用初始密码登录jenkins

    4. 安装插件