zoukankan      html  css  js  c++  java
  • Linux 配置Jenkins

    一、安装包下载:

    1. jdk-8u152-linux-x64.tar.gz下载:

        wget http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-8u152-linux-x64.tar.gz?AuthParam=1510049032_894becb76e01031b3099aafc33c5a06c

    2. maven-3/3.3.9下载:

        wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

    3. jenkins-2.88-1.1下载:

        wget https://prodjenkinsreleases.blob.core.windows.net/redhat/jenkins-2.88-1.1.noarch.rpm

    二、安装

    1. jdk安装:

    tar -zxvf jdk-8u152-linux-x64.tar.gz

    然后拷贝至自己安装软件的地方(我的是:/home/work/zach/soft/jdk1.8.0_152)

    2. maven安装:

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

    然后拷贝至自己安装软件的地方(我的是:/home/work/zach/soft/maven)

    3. jenkins安装:

    rpm -ivh jenkins-2.88-1.1.noarch.rpm

    jenkins默认安装至 /var/lib/jenkins

    三、配置:

    1. jdk与maven:

    vim /etc/profile

    unset i
    unset -f pathmunge
    export JAVA_HOME=/home/work/zach/soft/jdk1.8.0_152
    export MAVEN_HOME=/home/work/zach/soft/maven
    export JRE_HOME=${JAVA_HOME}/jre
    export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
    export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH

    保存后执行:source /etc/profile

    2. 启动jenkins前需修改 /etc/rc.d/init.d/jenkins:

    vim /etc/rc.d/init.d/jenkins

    candidates="
    /etc/alternatives/java
    /usr/lib/jvm/java-1.6.0/bin/java
    /usr/lib/jvm/jre-1.6.0/bin/java
    /usr/lib/jvm/java-1.7.0/bin/java
    /usr/lib/jvm/jre-1.7.0/bin/java
    /usr/lib/jvm/java-1.8.0/bin/java
    /usr/lib/jvm/jre-1.8.0/bin/java
    /usr/bin/java
    /home/work/zach/soft/jdk1.8.0_152/bin/java
    "

    注:蓝色字体为修改部分。

    四、权限问题

    1. Open up the this script (using VIM or other editor):

    vim /etc/sysconfig/jenkins

    2. Find this $JENKINS_USER and change to “root”:

    $JENKINS_USER="root"

    3. Then change the ownership of Jenkins home, webroot and logs:

    chown -R root:root /var/lib/jenkins
    chown -R root:root /var/cache/jenkins
    chown -R root:root /var/log/jenkins

    4) Restart Jenkins and check the user has been changed:

    service jenkins restart

  • 相关阅读:
    requets中urlencode的问题
    洛谷$P4503 [CTSC2014]$企鹅$QQ$ 哈希
    洛谷$P5446 [THUPC2018]$绿绿和串串 $manacher$
    洛谷$P5329 [SNOI2019]$字符串 字符串
    洛谷$P1390$ 公约数的和 欧拉函数
    洛谷$P4318$ 完全平方数 容斥+二分
    入门懵逼钨丝繁衍
    $ CometOJ-Contest#11 D$ $Kruscal$重构树
    洛谷$P4884$ 多少个1? 数论
    入门数论简单总结
  • 原文地址:https://www.cnblogs.com/FengZiQ/p/7804216.html
Copyright © 2011-2022 走看看