美文网首页
Jenkins 安装

Jenkins 安装

作者: 捞小虾 | 来源:发表于2020-01-18 13:05 被阅读0次

    Author: Xu FC
    Platform: Linux kali 5.3.0-kali2-amd64 #1 SMP Debian 5.3.9-3kali1 (2019-11-20) x86_64 GNU/Linux

    Jenkins 安装


    wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
    sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
    sudo apt-get update
    sudo apt-get install jenkins
    

    Jenkins 启动


    • 启动
    systemctl start jenkins
    
    • 添加开机启动
    systemctl enable jenkins
    
    • 查看状态
    root@kali:~# systemctl status jenkins
    ● jenkins.service - LSB: Start Jenkins at boot time
       Loaded: loaded (/etc/init.d/jenkins; generated)
       Active: active (exited) since Fri 2020-01-17 22:58:41 EST; 46min ago
         Docs: man:systemd-sysv-generator(8)
      Process: 631 ExecStart=/etc/init.d/jenkins start (code=exited, status=0/SUCCESS)
    
    Jan 17 22:58:39 kali systemd[1]: Starting LSB: Start Jenkins at boot time...
    Jan 17 22:58:39 kali jenkins[631]: Correct java version found
    Jan 17 22:58:39 kali su[905]: (to jenkins) root on none
    Jan 17 22:58:39 kali su[905]: pam_unix(su-l:session): session opened for user jenkins by (uid=0)
    Jan 17 22:58:40 kali su[905]: pam_unix(su-l:session): session closed for user jenkins
    Jan 17 22:58:41 kali jenkins[631]: Starting Jenkins Automation Server: jenkins.
    Jan 17 22:58:41 kali systemd[1]: Started LSB: Start Jenkins at boot time.
    
    • Web 默认端口号8080

    • 登陆页面会提示默认密码存放位置


      首次登陆
    • 根据提示安装插件,一个超级漫长的过程

    • 添加用户名和密码


      使用新添加的用户名和密码登录
    • 配置文件

    root@kali:~# more /etc/default/jenkins
    ......
    # pulled in from the init script; makes things easier.
    NAME=jenkins
    
    ......
    # port for HTTP connector (default 8080; disable with -1)
    HTTP_PORT=8080
    
    # servlet context, important if you want to use apache proxying
    PREFIX=/$NAME
    
    # arguments to pass to jenkins.
    # --javahome=$JAVA_HOME
    # --httpListenAddress=$HTTP_HOST (default 0.0.0.0)
    # --httpPort=$HTTP_PORT (default 8080; disable with -1)
    # --httpsPort=$HTTP_PORT
    # --argumentsRealm.passwd.$ADMIN_USER=[password]
    # --argumentsRealm.roles.$ADMIN_USER=admin
    # --webroot=~/.jenkins/war
    # --prefix=$PREFIX
    
    JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT"
    

    相关文章

      网友评论

          本文标题:Jenkins 安装

          本文链接:https://www.haomeiwen.com/subject/nsykzctx.html