• Linux安装Jenkins详细步骤


            安装jdk

    yum安装不需要配置环境变量

    安装maven

    下载maven

    压缩包上传至服务器 

    解压缩

     修改maven配置文件镜像地址

    配置环境变量

    安装Git

    安装Jenkins

    war包下载

     安装运行Jenkins


    安装jdk

    【Linux】Linux8 安装 JDK(适用于各个版本)_写bug的程序鱼的博客-CSDN博客

    yum安装不需要配置环境变量

    yum search jdk # yum查看jdk版本
    1. #yum install -y java-11-openjdk.x86_64
    2. #yum install -y java-11-openjdk-devel.x86_64
    3. #yum install -y java-11-openjdk-headless.x86_64 安装必要的(-y表示安装过程中都默认yes)
    1. rpm -qa | grep jdk
    2. copy-jdk-configs-3.3-10.el7_5.noarch
    3. java-11-openjdk-headless-11.0.13.0.8-1.el7_9.x86_64
    4. java-11-openjdk-11.0.13.0.8-1.el7_9.x86_64
    5. java-11-openjdk-devel-11.0.13.0.8-1.el7_9.x86_64 查看是否安装成功

    安装maven

    下载maven

    Maven – Download Apache Maven

     

    压缩包上传至服务器 

    解压缩

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

     修改maven配置文件镜像地址

    1. cd apache-maven-3.8.6/conf
    2. vim settings.xml

      

    配置环境变量

    export MAVEN_HOME=/root/apache-maven-3.8.6

    安装Git

    配置git地址时,jenkins会自动使用git命令,所以需要安装git

    yum install git
    1. Last metadata expiration check: 0:13:49 ago on Mon 21 Nov 2022 07:30:20 PM PST.
    2. Dependencies resolved.
    3. =============================================================================================================================================================================================
    4. Package Architecture Version Repository Size
    5. =============================================================================================================================================================================================
    6. Installing:
    7. git x86_64 2.27.0-1.el8 appstream 164 k
    8. Installing dependencies:
    9. git-core x86_64 2.27.0-1.el8 appstream 5.7 M
    10. git-core-doc noarch 2.27.0-1.el8 appstream 2.5 M
    11. perl-Error noarch 1:0.17025-2.el8 appstream 46 k
    12. perl-Git noarch 2.27.0-1.el8 appstream 77 k
    13. perl-TermReadKey x86_64 2.37-7.el8 appstream 40 k
    14. Transaction Summary
    15. =============================================================================================================================================================================================
    16. Install 6 Packages
    17. Total download size: 8.5 M
    18. Installed size: 45 M
    19. Is this ok [y/N]: y
    20. Downloading Packages:
    21. (1/6): git-2.27.0-1.el8.x86_64.rpm 19 kB/s | 164 kB 00:08
    22. (2/6): perl-Error-0.17025-2.el8.noarch.rpm 78 kB/s | 46 kB 00:00
    23. (3/6): perl-Git-2.27.0-1.el8.noarch.rpm 103 kB/s | 77 kB 00:00
    24. (4/6): perl-TermReadKey-2.37-7.el8.x86_64.rpm 54 kB/s | 40 kB 00:00
    25. (5/6): git-core-doc-2.27.0-1.el8.noarch.rpm 169 kB/s | 2.5 MB 00:15
    26. (6/6): git-core-2.27.0-1.el8.x86_64.rpm 296 kB/s | 5.7 MB 00:19
    27. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    28. Total 444 kB/s | 8.5 MB 00:19
    29. Running transaction check
    30. Transaction check succeeded.
    31. Running transaction test
    32. Transaction test succeeded.
    33. Running transaction
    34. Preparing : 1/1
    35. Installing : git-core-2.27.0-1.el8.x86_64 1/6
    36. Installing : git-core-doc-2.27.0-1.el8.noarch 2/6
    37. Installing : perl-TermReadKey-2.37-7.el8.x86_64 3/6
    38. Installing : perl-Error-1:0.17025-2.el8.noarch 4/6
    39. Installing : perl-Git-2.27.0-1.el8.noarch 5/6
    40. Installing : git-2.27.0-1.el8.x86_64 6/6
    41. Running scriptlet: git-2.27.0-1.el8.x86_64 6/6
    42. Verifying : git-2.27.0-1.el8.x86_64 1/6
    43. Verifying : git-core-2.27.0-1.el8.x86_64 2/6
    44. Verifying : git-core-doc-2.27.0-1.el8.noarch 3/6
    45. Verifying : perl-Error-1:0.17025-2.el8.noarch 4/6
    46. Verifying : perl-Git-2.27.0-1.el8.noarch 5/6
    47. Verifying : perl-TermReadKey-2.37-7.el8.x86_64 6/6
    48. Installed:
    49. git-2.27.0-1.el8.x86_64 git-core-2.27.0-1.el8.x86_64 git-core-doc-2.27.0-1.el8.noarch perl-Error-1:0.17025-2.el8.noarch perl-Git-2.27.0-1.el8.noarch perl-TermReadKey-2.37-7.el8.x86_64
    50. Complete!

    安装Jenkins

    war包下载

    Jenkins download and deployment

     安装运行Jenkins

     运行war包

    java -jar  jenkins.war

    在运行的日志里面可以看见提示:运行过程中已经在/root/.jenkins路径下创建了Jenkins相关的文件,其中默认用户admin,密码在/root/.jenkins/secrets/initialAdminPassword文件里面,日志里面也打印了密码如下: 

    1. *************************************************************
    2. *************************************************************
    3. *************************************************************
    4. Jenkins initial setup is required. An admin user has been created and a password generated.
    5. Please use the following password to proceed to installation:
    6. 7e8e8960825743fa983840ce28aec296
    7. This may also be found at: /root/.jenkins/secrets/initialAdminPassword
    8. *************************************************************
    9. *************************************************************
    10. *************************************************************

    http://192.168.216.134:8080

    输入默认密码:这个文件中/root/.jenkins/secrets/initialAdminPassword

     安装推荐插件即可

     输入你的邮箱姓名之类的输入完成

  • 相关阅读:
    python教程:封装与解构
    移动端适配
    商业楼智能照明解决方案,配套产品有哪些
    想要精通算法和SQL的成长之路 - 预测赢家
    《Unity Shader 入门精要》笔记04
    华为认证 | 安全HCIP和数通HCIP,该怎么选?
    阿里P8熬了一个月肝出这份32W字Java面试手册,在Github标星31K+
    mybatis-plus 标准分页功能
    YOLO-World:实时开放词汇目标检测
    导师演讲稿
  • 原文地址:https://blog.csdn.net/qq_55629923/article/details/127975716