目 录CONTENT

文章目录

centos7中安装Jenkins

DevWiki
2017-07-21 / 0 评论 / 0 点赞 / 29 阅读 / 0 字 / 正在检测是否收录...
温馨提示:
本文最后更新于2024-03-31,若内容或图片失效,请留言反馈。 部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

0x01 更新安装源

更细安装源

# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

--2017-07-21 03:04:18--  https://pkg.jenkins.io/redhat-stable/jenkins.repo
Resolving pkg.jenkins.io (pkg.jenkins.io)... 52.202.51.185
Connecting to pkg.jenkins.io (pkg.jenkins.io)|52.202.51.185|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85
Saving to: '/etc/yum.repos.d/jenkins.repo'

100%[==============================================================================>] 85          --.-K/s   in 0s    

2017-07-21 03:04:19 (6.21 MB/s) - '/etc/yum.repos.d/jenkins.repo' saved [85/85]

0x02 导入使之生效

rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

0x03 开始安装

# yum install jenkins

Loaded plugins: fastestmirror
base                                                                                             | 3.6 kB  00:00:00   
extras                                                                                           | 3.4 kB  00:00:00   
jenkins                                                                                          | 2.9 kB  00:00:00   
updates                                                                                          | 3.4 kB  00:00:00   
jenkins/primary_db                                                                               |  21 kB  00:00:00   
Loading mirror speeds from cached hostfile
 * base: centos-distro.cavecreek.net
 * extras: centos-distro.cavecreek.net
 * updates: mirror.hmc.edu
Resolving Dependencies
--> Running transaction check
---> Package jenkins.noarch 0:2.60.2-1.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                    Arch                      Version                          Repository                  Size
========================================================================================================================
Installing:
 jenkins                    noarch                    2.60.2-1.1                       jenkins                     67 M

Transaction Summary
========================================================================================================================
Install  1 Package

Total download size: 67 M
Installed size: 67 M
Is this ok [y/d/N]: y
Downloading packages:
jenkins-2.60.2-1.1.noarch.rpm                                                                    |  67 MB  00:00:07   
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : jenkins-2.60.2-1.1.noarch                                                                            1/1 
  Verifying  : jenkins-2.60.2-1.1.noarch                                                                            1/1 

Installed:
  jenkins.noarch 0:2.60.2-1.1                                                                                         

Complete!

0x04 起动Jenkins服务

# service jenkins start
Starting jenkins (via systemctl):                          [  OK  ]

访问网站查看安装结果,首次访问需要输入管理员密码,密码位置在:

[root@localhost opt]# cd /var/lib/jenkins/secrets/
[root@localhost secrets]# ll
total 36
drwxr-xr-x 2 jenkins jenkins 4096 Jul 21 03:26 filepath-filters.d
-rw-r--r-- 1 jenkins jenkins  272 Jul 21 03:26 hudson.util.Secret
-rw-r----- 1 jenkins jenkins   33 Jul 21 03:26 initialAdminPassword
-rw-r--r-- 1 jenkins jenkins   32 Jul 21 03:26 jenkins.model.Jenkins.crumbSalt
-rw-r--r-- 1 jenkins jenkins   48 Jul 21 03:26 jenkins.security.ApiTokenProperty.seed
-rw-r--r-- 1 jenkins jenkins  256 Jul 21 03:26 master.key
-rw-r--r-- 1 jenkins jenkins  272 Jul 21 03:26 org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
-rw-r--r-- 1 jenkins jenkins    5 Jul 21 03:26 slave-to-master-security-kill-switch
drwxr-xr-x 2 jenkins jenkins 4096 Jul 21 03:26 whitelisted-callables.d

//查看密码
[root@localhost secrets]# cat initialAdminPassword

输入密码后,根据界面要求输入必要信息,然后安装推荐插件即可进入界面了.

Jenkins-first-page.jpg (748×482)

0x05 配置Jenkins

打开: 系统管理 ---> Global Tool Configuration

1.设置Jdk

jenkins-setting-jdk.png (746×216)

2.设置git

jenkins-setting-git.png (677×224)

3. 设置gradle

jenkins-setting-gradle.png (663×205)

4.设置ant

jenkins-setting-ant.png (644×186)

5. 设置maven

jenkins-setting-maven.png (638×214)

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin
博主关闭了所有页面的评论