3月 042020
 

主机节点列表

18.163.73.239/172.31.37.77/server1
18.163.127.151/172.31.47.26/server2
18.162.214.175/172.31.46.199/server3
18.163.190.28/172.31.35.162/server4
18.163.181.22/172.31.37.31/server5

修改Jenkins服务所在主机的ssh客户端主机密钥检查设置

[root@ip-172-31-32-243 ~]# vi /etc/ssh/ssh_config
# StrictHostKeyChecking ask
StrictHostKeyChecking no

主备Jenkins构建主机清单

18.163.73.239
18.163.127.151
18.162.214.175
18.163.190.28
18.163.181.22

准备Ansible模块shell的执行脚本

sudo setenforce 0;
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config;
sudo sh -c 'echo "172.31.37.77 server1" >> /etc/hosts';
sudo sh -c 'echo "172.31.47.26 server2" >> /etc/hosts';
sudo sh -c 'echo "172.31.46.199 server3" >> /etc/hosts';
sudo sh -c 'echo "172.31.35.162 server4" >> /etc/hosts';
sudo sh -c 'echo "172.31.37.31 server5" >> /etc/hosts';
sudo yum -y install yum-utils device-mapper-persistent-data lvm2;
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo;
sudo yum -y install docker-ce docker-ce-cli containerd.io;
sudo systemctl enable docker;
sudo systemctl start docker;

执行hosts文件修改时的sudo命令权限问题

需要提升权限两次
sudo echo -e "172.31.37.77 server1" >> /etc/hosts;

需要提升权限一次
sudo sh -c 'echo "172.31.37.77 server1" >> /etc/hosts';

添加主机

添加Ansible插件

配置Ansbile工具名称和路径

添加鉴权配置

创建一个自由风格项目

配置项目构建信息

执行项目构建

构建任务的控制台信息输出

Console Output

Started by user admin
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/Deploy_Docker_Engine
[Deploy_Docker_Engine] $ /usr/bin/ansible all -i /tmp/inventory5005067274247757205.ini -m shell -a 'sudo setenforce 0;
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config;
sudo sh -c 'echo "172.31.37.77 server1" >> /etc/hosts';
sudo sh -c 'echo "172.31.47.26 server2" >> /etc/hosts';
sudo sh -c 'echo "172.31.46.199 server3" >> /etc/hosts';
sudo sh -c 'echo "172.31.35.162 server4" >> /etc/hosts';
sudo sh -c 'echo "172.31.37.31 server5" >> /etc/hosts';
sudo yum -y install yum-utils device-mapper-persistent-data lvm2;
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo;
sudo yum -y install docker-ce docker-ce-cli containerd.io;
sudo systemctl enable docker;
sudo systemctl start docker;' -f 5 --private-key /tmp/ssh7494460564885512494.key -u centos

[WARNING]: Consider using 'become', 'become_method', and 'become_user' rather
than running sudo
18.162.214.175 | CHANGED | rc=0 >>
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-1.el7 will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
---> Package lvm2.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: lvm2-libs = 7:2.02.185-2.el7_7.2 for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
---> Package yum-utils.noarch 0:1.1.31-50.el7 will be updated
---> Package yum-utils.noarch 0:1.1.31-52.el7 will be an update
--> Running transaction check
---> Package device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2 will be installed
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package lvm2-libs.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper-event = 7:1.02.158-2.el7_7.2 for package: 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.158-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper = 7:1.02.158-2.el7_7.2 for package: 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.149-10.el7_6.2 will be updated
--> Processing Dependency: device-mapper = 7:1.02.149-10.el7_6.2 for package: 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64
---> Package device-mapper.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Running transaction check
---> Package device-mapper-libs.x86_64 7:1.02.149-10.el7_6.2 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                        Arch    Version                  Repository
                                                                           Size
================================================================================
Installing:
 device-mapper-persistent-data  x86_64  0.8.5-1.el7              base     423 k
 lvm2                           x86_64  7:2.02.185-2.el7_7.2     updates  1.3 M
Updating:
 yum-utils                      noarch  1.1.31-52.el7            base     121 k
Installing for dependencies:
 device-mapper-event            x86_64  7:1.02.158-2.el7_7.2     updates  190 k
 device-mapper-event-libs       x86_64  7:1.02.158-2.el7_7.2     updates  189 k
 libaio                         x86_64  0.3.109-13.el7           base      24 k
 lvm2-libs                      x86_64  7:2.02.185-2.el7_7.2     updates  1.1 M
Updating for dependencies:
 device-mapper                  x86_64  7:1.02.158-2.el7_7.2     updates  294 k
 device-mapper-libs             x86_64  7:1.02.158-2.el7_7.2     updates  322 k

Transaction Summary
================================================================================
Install  2 Packages (+4 Dependent packages)
Upgrade  1 Package  (+2 Dependent packages)

Total download size: 3.9 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Public key for device-mapper-1.02.158-2.el7_7.2.x86_64.rpm is not installed
Public key for device-mapper-persistent-data-0.8.5-1.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                               30 MB/s | 3.9 MB  00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   1/12 
  Updating   : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              2/12 
  Installing : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        3/12 
  Installing : libaio-0.3.109-13.el7.x86_64                                4/12 
  Installing : device-mapper-persistent-data-0.8.5-1.el7.x86_64            5/12 
  Installing : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             6/12 
  Installing : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       7/12 
  Installing : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            8/12 
  Updating   : yum-utils-1.1.31-52.el7.noarch                              9/12 
  Cleanup    : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Cleanup    : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Cleanup    : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 
  Verifying  : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              1/12 
  Verifying  : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   2/12 
  Verifying  : yum-utils-1.1.31-52.el7.noarch                              3/12 
  Verifying  : device-mapper-persistent-data-0.8.5-1.el7.x86_64            4/12 
  Verifying  : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            5/12 
  Verifying  : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       6/12 
  Verifying  : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             7/12 
  Verifying  : libaio-0.3.109-13.el7.x86_64                                8/12 
  Verifying  : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        9/12 
  Verifying  : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Verifying  : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Verifying  : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 

Installed:
  device-mapper-persistent-data.x86_64 0:0.8.5-1.el7                            
  lvm2.x86_64 7:2.02.185-2.el7_7.2                                              

Dependency Installed:
  device-mapper-event.x86_64 7:1.02.158-2.el7_7.2                               
  device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2                          
  libaio.x86_64 0:0.3.109-13.el7                                                
  lvm2-libs.x86_64 7:2.02.185-2.el7_7.2                                         

Updated:
  yum-utils.noarch 0:1.1.31-52.el7                                              

Dependency Updated:
  device-mapper.x86_64 7:1.02.158-2.el7_7.2                                     
  device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2                                

Complete!
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.13-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.2.13-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.7-3.el7 will be installed
---> Package docker-ce-cli.x86_64 1:19.03.7-3.el7 will be installed
--> Running transaction check
---> Package container-selinux.noarch 2:2.107-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch      Version               Repository           Size
================================================================================
Installing:
 containerd.io        x86_64    1.2.13-3.1.el7        docker-ce-stable     23 M
 docker-ce            x86_64    3:19.03.7-3.el7       docker-ce-stable     25 M
 docker-ce-cli        x86_64    1:19.03.7-3.el7       docker-ce-stable     40 M
Installing for dependencies:
 container-selinux    noarch    2:2.107-3.el7         extras               39 k

Transaction Summary
================================================================================
Install  3 Packages (+1 Dependent package)

Total download size: 87 M
Installed size: 363 M
Downloading packages:
Public key for containerd.io-1.2.13-3.1.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                              141 MB/s |  87 MB  00:00     
Retrieving key from https://download.docker.com/linux/centos/gpg
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:container-selinux-2.107-3.el7.noarch                       1/4 
  Installing : containerd.io-1.2.13-3.1.el7.x86_64                          2/4 
  Installing : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Installing : 3:docker-ce-19.03.7-3.el7.x86_64                             4/4 
  Verifying  : containerd.io-1.2.13-3.1.el7.x86_64                          1/4 
  Verifying  : 3:docker-ce-19.03.7-3.el7.x86_64                             2/4 
  Verifying  : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Verifying  : 2:container-selinux-2.107-3.el7.noarch                       4/4 

Installed:
  containerd.io.x86_64 0:1.2.13-3.1.el7     docker-ce.x86_64 3:19.03.7-3.el7    
  docker-ce-cli.x86_64 1:19.03.7-3.el7     

Dependency Installed:
  container-selinux.noarch 2:2.107-3.el7                                        

Complete!warning: /var/cache/yum/x86_64/7/updates/packages/device-mapper-1.02.158-2.el7_7.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-6.1810.2.el7.centos.x86_64 (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.2.13-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <docker@docker.com>"
 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 From       : https://download.docker.com/linux/centos/gpg
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

18.163.190.28 | CHANGED | rc=0 >>
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-1.el7 will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
---> Package lvm2.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: lvm2-libs = 7:2.02.185-2.el7_7.2 for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
---> Package yum-utils.noarch 0:1.1.31-50.el7 will be updated
---> Package yum-utils.noarch 0:1.1.31-52.el7 will be an update
--> Running transaction check
---> Package device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2 will be installed
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package lvm2-libs.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper-event = 7:1.02.158-2.el7_7.2 for package: 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.158-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper = 7:1.02.158-2.el7_7.2 for package: 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.149-10.el7_6.2 will be updated
--> Processing Dependency: device-mapper = 7:1.02.149-10.el7_6.2 for package: 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64
---> Package device-mapper.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Running transaction check
---> Package device-mapper-libs.x86_64 7:1.02.149-10.el7_6.2 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                        Arch    Version                  Repository
                                                                           Size
================================================================================
Installing:
 device-mapper-persistent-data  x86_64  0.8.5-1.el7              base     423 k
 lvm2                           x86_64  7:2.02.185-2.el7_7.2     updates  1.3 M
Updating:
 yum-utils                      noarch  1.1.31-52.el7            base     121 k
Installing for dependencies:
 device-mapper-event            x86_64  7:1.02.158-2.el7_7.2     updates  190 k
 device-mapper-event-libs       x86_64  7:1.02.158-2.el7_7.2     updates  189 k
 libaio                         x86_64  0.3.109-13.el7           base      24 k
 lvm2-libs                      x86_64  7:2.02.185-2.el7_7.2     updates  1.1 M
Updating for dependencies:
 device-mapper                  x86_64  7:1.02.158-2.el7_7.2     updates  294 k
 device-mapper-libs             x86_64  7:1.02.158-2.el7_7.2     updates  322 k

Transaction Summary
================================================================================
Install  2 Packages (+4 Dependent packages)
Upgrade  1 Package  (+2 Dependent packages)

Total download size: 3.9 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Public key for device-mapper-1.02.158-2.el7_7.2.x86_64.rpm is not installed
Public key for libaio-0.3.109-13.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                               22 MB/s | 3.9 MB  00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   1/12 
  Updating   : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              2/12 
  Installing : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        3/12 
  Installing : libaio-0.3.109-13.el7.x86_64                                4/12 
  Installing : device-mapper-persistent-data-0.8.5-1.el7.x86_64            5/12 
  Installing : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             6/12 
  Installing : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       7/12 
  Installing : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            8/12 
  Updating   : yum-utils-1.1.31-52.el7.noarch                              9/12 
  Cleanup    : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Cleanup    : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Cleanup    : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 
  Verifying  : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              1/12 
  Verifying  : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   2/12 
  Verifying  : yum-utils-1.1.31-52.el7.noarch                              3/12 
  Verifying  : device-mapper-persistent-data-0.8.5-1.el7.x86_64            4/12 
  Verifying  : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            5/12 
  Verifying  : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       6/12 
  Verifying  : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             7/12 
  Verifying  : libaio-0.3.109-13.el7.x86_64                                8/12 
  Verifying  : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        9/12 
  Verifying  : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Verifying  : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Verifying  : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 

Installed:
  device-mapper-persistent-data.x86_64 0:0.8.5-1.el7                            
  lvm2.x86_64 7:2.02.185-2.el7_7.2                                              

Dependency Installed:
  device-mapper-event.x86_64 7:1.02.158-2.el7_7.2                               
  device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2                          
  libaio.x86_64 0:0.3.109-13.el7                                                
  lvm2-libs.x86_64 7:2.02.185-2.el7_7.2                                         

Updated:
  yum-utils.noarch 0:1.1.31-52.el7                                              

Dependency Updated:
  device-mapper.x86_64 7:1.02.158-2.el7_7.2                                     
  device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2                                

Complete!
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.13-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.2.13-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.7-3.el7 will be installed
---> Package docker-ce-cli.x86_64 1:19.03.7-3.el7 will be installed
--> Running transaction check
---> Package container-selinux.noarch 2:2.107-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch      Version               Repository           Size
================================================================================
Installing:
 containerd.io        x86_64    1.2.13-3.1.el7        docker-ce-stable     23 M
 docker-ce            x86_64    3:19.03.7-3.el7       docker-ce-stable     25 M
 docker-ce-cli        x86_64    1:19.03.7-3.el7       docker-ce-stable     40 M
Installing for dependencies:
 container-selinux    noarch    2:2.107-3.el7         extras               39 k

Transaction Summary
================================================================================
Install  3 Packages (+1 Dependent package)

Total download size: 87 M
Installed size: 363 M
Downloading packages:
Public key for containerd.io-1.2.13-3.1.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                              131 MB/s |  87 MB  00:00     
Retrieving key from https://download.docker.com/linux/centos/gpg
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:container-selinux-2.107-3.el7.noarch                       1/4 
  Installing : containerd.io-1.2.13-3.1.el7.x86_64                          2/4 
  Installing : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Installing : 3:docker-ce-19.03.7-3.el7.x86_64                             4/4 
  Verifying  : containerd.io-1.2.13-3.1.el7.x86_64                          1/4 
  Verifying  : 3:docker-ce-19.03.7-3.el7.x86_64                             2/4 
  Verifying  : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Verifying  : 2:container-selinux-2.107-3.el7.noarch                       4/4 

Installed:
  containerd.io.x86_64 0:1.2.13-3.1.el7     docker-ce.x86_64 3:19.03.7-3.el7    
  docker-ce-cli.x86_64 1:19.03.7-3.el7     

Dependency Installed:
  container-selinux.noarch 2:2.107-3.el7                                        

Complete!warning: /var/cache/yum/x86_64/7/updates/packages/device-mapper-1.02.158-2.el7_7.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-6.1810.2.el7.centos.x86_64 (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.2.13-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <docker@docker.com>"
 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 From       : https://download.docker.com/linux/centos/gpg
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
18.163.181.22 | CHANGED | rc=0 >>
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-1.el7 will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
---> Package lvm2.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: lvm2-libs = 7:2.02.185-2.el7_7.2 for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
---> Package yum-utils.noarch 0:1.1.31-50.el7 will be updated
---> Package yum-utils.noarch 0:1.1.31-52.el7 will be an update
--> Running transaction check
---> Package device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2 will be installed
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package lvm2-libs.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper-event = 7:1.02.158-2.el7_7.2 for package: 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.158-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper = 7:1.02.158-2.el7_7.2 for package: 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.149-10.el7_6.2 will be updated
--> Processing Dependency: device-mapper = 7:1.02.149-10.el7_6.2 for package: 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64
---> Package device-mapper.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Running transaction check
---> Package device-mapper-libs.x86_64 7:1.02.149-10.el7_6.2 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                        Arch    Version                  Repository
                                                                           Size
================================================================================
Installing:
 device-mapper-persistent-data  x86_64  0.8.5-1.el7              base     423 k
 lvm2                           x86_64  7:2.02.185-2.el7_7.2     updates  1.3 M
Updating:
 yum-utils                      noarch  1.1.31-52.el7            base     121 k
Installing for dependencies:
 device-mapper-event            x86_64  7:1.02.158-2.el7_7.2     updates  190 k
 device-mapper-event-libs       x86_64  7:1.02.158-2.el7_7.2     updates  189 k
 libaio                         x86_64  0.3.109-13.el7           base      24 k
 lvm2-libs                      x86_64  7:2.02.185-2.el7_7.2     updates  1.1 M
Updating for dependencies:
 device-mapper                  x86_64  7:1.02.158-2.el7_7.2     updates  294 k
 device-mapper-libs             x86_64  7:1.02.158-2.el7_7.2     updates  322 k

Transaction Summary
================================================================================
Install  2 Packages (+4 Dependent packages)
Upgrade  1 Package  (+2 Dependent packages)

Total download size: 3.9 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Public key for device-mapper-1.02.158-2.el7_7.2.x86_64.rpm is not installed
Public key for device-mapper-persistent-data-0.8.5-1.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                               26 MB/s | 3.9 MB  00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   1/12 
  Updating   : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              2/12 
  Installing : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        3/12 
  Installing : libaio-0.3.109-13.el7.x86_64                                4/12 
  Installing : device-mapper-persistent-data-0.8.5-1.el7.x86_64            5/12 
  Installing : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             6/12 
  Installing : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       7/12 
  Installing : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            8/12 
  Updating   : yum-utils-1.1.31-52.el7.noarch                              9/12 
  Cleanup    : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Cleanup    : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Cleanup    : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 
  Verifying  : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              1/12 
  Verifying  : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   2/12 
  Verifying  : yum-utils-1.1.31-52.el7.noarch                              3/12 
  Verifying  : device-mapper-persistent-data-0.8.5-1.el7.x86_64            4/12 
  Verifying  : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            5/12 
  Verifying  : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       6/12 
  Verifying  : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             7/12 
  Verifying  : libaio-0.3.109-13.el7.x86_64                                8/12 
  Verifying  : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        9/12 
  Verifying  : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Verifying  : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Verifying  : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 

Installed:
  device-mapper-persistent-data.x86_64 0:0.8.5-1.el7                            
  lvm2.x86_64 7:2.02.185-2.el7_7.2                                              

Dependency Installed:
  device-mapper-event.x86_64 7:1.02.158-2.el7_7.2                               
  device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2                          
  libaio.x86_64 0:0.3.109-13.el7                                                
  lvm2-libs.x86_64 7:2.02.185-2.el7_7.2                                         

Updated:
  yum-utils.noarch 0:1.1.31-52.el7                                              

Dependency Updated:
  device-mapper.x86_64 7:1.02.158-2.el7_7.2                                     
  device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2                                

Complete!
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.13-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.2.13-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.7-3.el7 will be installed
---> Package docker-ce-cli.x86_64 1:19.03.7-3.el7 will be installed
--> Running transaction check
---> Package container-selinux.noarch 2:2.107-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch      Version               Repository           Size
================================================================================
Installing:
 containerd.io        x86_64    1.2.13-3.1.el7        docker-ce-stable     23 M
 docker-ce            x86_64    3:19.03.7-3.el7       docker-ce-stable     25 M
 docker-ce-cli        x86_64    1:19.03.7-3.el7       docker-ce-stable     40 M
Installing for dependencies:
 container-selinux    noarch    2:2.107-3.el7         extras               39 k

Transaction Summary
================================================================================
Install  3 Packages (+1 Dependent package)

Total download size: 87 M
Installed size: 363 M
Downloading packages:
Public key for containerd.io-1.2.13-3.1.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                              129 MB/s |  87 MB  00:00     
Retrieving key from https://download.docker.com/linux/centos/gpg
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:container-selinux-2.107-3.el7.noarch                       1/4 
  Installing : containerd.io-1.2.13-3.1.el7.x86_64                          2/4 
  Installing : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Installing : 3:docker-ce-19.03.7-3.el7.x86_64                             4/4 
  Verifying  : containerd.io-1.2.13-3.1.el7.x86_64                          1/4 
  Verifying  : 3:docker-ce-19.03.7-3.el7.x86_64                             2/4 
  Verifying  : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Verifying  : 2:container-selinux-2.107-3.el7.noarch                       4/4 

Installed:
  containerd.io.x86_64 0:1.2.13-3.1.el7     docker-ce.x86_64 3:19.03.7-3.el7    
  docker-ce-cli.x86_64 1:19.03.7-3.el7     

Dependency Installed:
  container-selinux.noarch 2:2.107-3.el7                                        

Complete!warning: /var/cache/yum/x86_64/7/updates/packages/device-mapper-1.02.158-2.el7_7.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-6.1810.2.el7.centos.x86_64 (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.2.13-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <docker@docker.com>"
 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 From       : https://download.docker.com/linux/centos/gpg
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

18.163.73.239 | CHANGED | rc=0 >>
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-1.el7 will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
---> Package lvm2.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: lvm2-libs = 7:2.02.185-2.el7_7.2 for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
---> Package yum-utils.noarch 0:1.1.31-50.el7 will be updated
---> Package yum-utils.noarch 0:1.1.31-52.el7 will be an update
--> Running transaction check
---> Package device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2 will be installed
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package lvm2-libs.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper-event = 7:1.02.158-2.el7_7.2 for package: 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.158-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper = 7:1.02.158-2.el7_7.2 for package: 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.149-10.el7_6.2 will be updated
--> Processing Dependency: device-mapper = 7:1.02.149-10.el7_6.2 for package: 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64
---> Package device-mapper.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Running transaction check
---> Package device-mapper-libs.x86_64 7:1.02.149-10.el7_6.2 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                        Arch    Version                  Repository
                                                                           Size
================================================================================
Installing:
 device-mapper-persistent-data  x86_64  0.8.5-1.el7              base     423 k
 lvm2                           x86_64  7:2.02.185-2.el7_7.2     updates  1.3 M
Updating:
 yum-utils                      noarch  1.1.31-52.el7            base     121 k
Installing for dependencies:
 device-mapper-event            x86_64  7:1.02.158-2.el7_7.2     updates  190 k
 device-mapper-event-libs       x86_64  7:1.02.158-2.el7_7.2     updates  189 k
 libaio                         x86_64  0.3.109-13.el7           base      24 k
 lvm2-libs                      x86_64  7:2.02.185-2.el7_7.2     updates  1.1 M
Updating for dependencies:
 device-mapper                  x86_64  7:1.02.158-2.el7_7.2     updates  294 k
 device-mapper-libs             x86_64  7:1.02.158-2.el7_7.2     updates  322 k

Transaction Summary
================================================================================
Install  2 Packages (+4 Dependent packages)
Upgrade  1 Package  (+2 Dependent packages)

Total download size: 3.9 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Public key for device-mapper-1.02.158-2.el7_7.2.x86_64.rpm is not installed
Public key for libaio-0.3.109-13.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                               25 MB/s | 3.9 MB  00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   1/12 
  Updating   : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              2/12 
  Installing : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        3/12 
  Installing : libaio-0.3.109-13.el7.x86_64                                4/12 
  Installing : device-mapper-persistent-data-0.8.5-1.el7.x86_64            5/12 
  Installing : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             6/12 
  Installing : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       7/12 
  Installing : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            8/12 
  Updating   : yum-utils-1.1.31-52.el7.noarch                              9/12 
  Cleanup    : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Cleanup    : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Cleanup    : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 
  Verifying  : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              1/12 
  Verifying  : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   2/12 
  Verifying  : yum-utils-1.1.31-52.el7.noarch                              3/12 
  Verifying  : device-mapper-persistent-data-0.8.5-1.el7.x86_64            4/12 
  Verifying  : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            5/12 
  Verifying  : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       6/12 
  Verifying  : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             7/12 
  Verifying  : libaio-0.3.109-13.el7.x86_64                                8/12 
  Verifying  : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        9/12 
  Verifying  : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Verifying  : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Verifying  : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 

Installed:
  device-mapper-persistent-data.x86_64 0:0.8.5-1.el7                            
  lvm2.x86_64 7:2.02.185-2.el7_7.2                                              

Dependency Installed:
  device-mapper-event.x86_64 7:1.02.158-2.el7_7.2                               
  device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2                          
  libaio.x86_64 0:0.3.109-13.el7                                                
  lvm2-libs.x86_64 7:2.02.185-2.el7_7.2                                         

Updated:
  yum-utils.noarch 0:1.1.31-52.el7                                              

Dependency Updated:
  device-mapper.x86_64 7:1.02.158-2.el7_7.2                                     
  device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2                                

Complete!
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.13-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.2.13-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.7-3.el7 will be installed
---> Package docker-ce-cli.x86_64 1:19.03.7-3.el7 will be installed
--> Running transaction check
---> Package container-selinux.noarch 2:2.107-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch      Version               Repository           Size
================================================================================
Installing:
 containerd.io        x86_64    1.2.13-3.1.el7        docker-ce-stable     23 M
 docker-ce            x86_64    3:19.03.7-3.el7       docker-ce-stable     25 M
 docker-ce-cli        x86_64    1:19.03.7-3.el7       docker-ce-stable     40 M
Installing for dependencies:
 container-selinux    noarch    2:2.107-3.el7         extras               39 k

Transaction Summary
================================================================================
Install  3 Packages (+1 Dependent package)

Total download size: 87 M
Installed size: 363 M
Downloading packages:
Public key for containerd.io-1.2.13-3.1.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                              112 MB/s |  87 MB  00:00     
Retrieving key from https://download.docker.com/linux/centos/gpg
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:container-selinux-2.107-3.el7.noarch                       1/4 
  Installing : containerd.io-1.2.13-3.1.el7.x86_64                          2/4 
  Installing : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Installing : 3:docker-ce-19.03.7-3.el7.x86_64                             4/4 
  Verifying  : containerd.io-1.2.13-3.1.el7.x86_64                          1/4 
  Verifying  : 3:docker-ce-19.03.7-3.el7.x86_64                             2/4 
  Verifying  : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Verifying  : 2:container-selinux-2.107-3.el7.noarch                       4/4 

Installed:
  containerd.io.x86_64 0:1.2.13-3.1.el7     docker-ce.x86_64 3:19.03.7-3.el7    
  docker-ce-cli.x86_64 1:19.03.7-3.el7     

Dependency Installed:
  container-selinux.noarch 2:2.107-3.el7                                        

Complete!warning: /var/cache/yum/x86_64/7/updates/packages/device-mapper-1.02.158-2.el7_7.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-6.1810.2.el7.centos.x86_64 (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.2.13-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <docker@docker.com>"
 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 From       : https://download.docker.com/linux/centos/gpg
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

18.163.127.151 | CHANGED | rc=0 >>
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package device-mapper-persistent-data.x86_64 0:0.8.5-1.el7 will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: device-mapper-persistent-data-0.8.5-1.el7.x86_64
---> Package lvm2.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: lvm2-libs = 7:2.02.185-2.el7_7.2 for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02(Base)(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: liblvm2app.so.2.2()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02()(64bit) for package: 7:lvm2-2.02.185-2.el7_7.2.x86_64
---> Package yum-utils.noarch 0:1.1.31-50.el7 will be updated
---> Package yum-utils.noarch 0:1.1.31-52.el7 will be an update
--> Running transaction check
---> Package device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2 will be installed
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
---> Package lvm2-libs.x86_64 7:2.02.185-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper-event = 7:1.02.158-2.el7_7.2 for package: 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.158-2.el7_7.2 will be installed
--> Processing Dependency: device-mapper = 7:1.02.158-2.el7_7.2 for package: 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64
--> Running transaction check
---> Package device-mapper.x86_64 7:1.02.149-10.el7_6.2 will be updated
--> Processing Dependency: device-mapper = 7:1.02.149-10.el7_6.2 for package: 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64
---> Package device-mapper.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Running transaction check
---> Package device-mapper-libs.x86_64 7:1.02.149-10.el7_6.2 will be updated
---> Package device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                        Arch    Version                  Repository
                                                                           Size
================================================================================
Installing:
 device-mapper-persistent-data  x86_64  0.8.5-1.el7              base     423 k
 lvm2                           x86_64  7:2.02.185-2.el7_7.2     updates  1.3 M
Updating:
 yum-utils                      noarch  1.1.31-52.el7            base     121 k
Installing for dependencies:
 device-mapper-event            x86_64  7:1.02.158-2.el7_7.2     updates  190 k
 device-mapper-event-libs       x86_64  7:1.02.158-2.el7_7.2     updates  189 k
 libaio                         x86_64  0.3.109-13.el7           base      24 k
 lvm2-libs                      x86_64  7:2.02.185-2.el7_7.2     updates  1.1 M
Updating for dependencies:
 device-mapper                  x86_64  7:1.02.158-2.el7_7.2     updates  294 k
 device-mapper-libs             x86_64  7:1.02.158-2.el7_7.2     updates  322 k

Transaction Summary
================================================================================
Install  2 Packages (+4 Dependent packages)
Upgrade  1 Package  (+2 Dependent packages)

Total download size: 3.9 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Public key for device-mapper-1.02.158-2.el7_7.2.x86_64.rpm is not installed
Public key for device-mapper-persistent-data-0.8.5-1.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                              6.6 MB/s | 3.9 MB  00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   1/12 
  Updating   : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              2/12 
  Installing : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        3/12 
  Installing : libaio-0.3.109-13.el7.x86_64                                4/12 
  Installing : device-mapper-persistent-data-0.8.5-1.el7.x86_64            5/12 
  Installing : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             6/12 
  Installing : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       7/12 
  Installing : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            8/12 
  Updating   : yum-utils-1.1.31-52.el7.noarch                              9/12 
  Cleanup    : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Cleanup    : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Cleanup    : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 
  Verifying  : 7:device-mapper-libs-1.02.158-2.el7_7.2.x86_64              1/12 
  Verifying  : 7:device-mapper-1.02.158-2.el7_7.2.x86_64                   2/12 
  Verifying  : yum-utils-1.1.31-52.el7.noarch                              3/12 
  Verifying  : device-mapper-persistent-data-0.8.5-1.el7.x86_64            4/12 
  Verifying  : 7:lvm2-2.02.185-2.el7_7.2.x86_64                            5/12 
  Verifying  : 7:lvm2-libs-2.02.185-2.el7_7.2.x86_64                       6/12 
  Verifying  : 7:device-mapper-event-1.02.158-2.el7_7.2.x86_64             7/12 
  Verifying  : libaio-0.3.109-13.el7.x86_64                                8/12 
  Verifying  : 7:device-mapper-event-libs-1.02.158-2.el7_7.2.x86_64        9/12 
  Verifying  : yum-utils-1.1.31-50.el7.noarch                             10/12 
  Verifying  : 7:device-mapper-1.02.149-10.el7_6.2.x86_64                 11/12 
  Verifying  : 7:device-mapper-libs-1.02.149-10.el7_6.2.x86_64            12/12 

Installed:
  device-mapper-persistent-data.x86_64 0:0.8.5-1.el7                            
  lvm2.x86_64 7:2.02.185-2.el7_7.2                                              

Dependency Installed:
  device-mapper-event.x86_64 7:1.02.158-2.el7_7.2                               
  device-mapper-event-libs.x86_64 7:1.02.158-2.el7_7.2                          
  libaio.x86_64 0:0.3.109-13.el7                                                
  lvm2-libs.x86_64 7:2.02.185-2.el7_7.2                                         

Updated:
  yum-utils.noarch 0:1.1.31-52.el7                                              

Dependency Updated:
  device-mapper.x86_64 7:1.02.158-2.el7_7.2                                     
  device-mapper-libs.x86_64 7:1.02.158-2.el7_7.2                                

Complete!
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.13-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.2.13-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.7-3.el7 will be installed
---> Package docker-ce-cli.x86_64 1:19.03.7-3.el7 will be installed
--> Running transaction check
---> Package container-selinux.noarch 2:2.107-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch      Version               Repository           Size
================================================================================
Installing:
 containerd.io        x86_64    1.2.13-3.1.el7        docker-ce-stable     23 M
 docker-ce            x86_64    3:19.03.7-3.el7       docker-ce-stable     25 M
 docker-ce-cli        x86_64    1:19.03.7-3.el7       docker-ce-stable     40 M
Installing for dependencies:
 container-selinux    noarch    2:2.107-3.el7         extras               39 k

Transaction Summary
================================================================================
Install  3 Packages (+1 Dependent package)

Total download size: 87 M
Installed size: 363 M
Downloading packages:
Public key for containerd.io-1.2.13-3.1.el7.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                              118 MB/s |  87 MB  00:00     
Retrieving key from https://download.docker.com/linux/centos/gpg
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:container-selinux-2.107-3.el7.noarch                       1/4 
  Installing : containerd.io-1.2.13-3.1.el7.x86_64                          2/4 
  Installing : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Installing : 3:docker-ce-19.03.7-3.el7.x86_64                             4/4 
  Verifying  : containerd.io-1.2.13-3.1.el7.x86_64                          1/4 
  Verifying  : 3:docker-ce-19.03.7-3.el7.x86_64                             2/4 
  Verifying  : 1:docker-ce-cli-19.03.7-3.el7.x86_64                         3/4 
  Verifying  : 2:container-selinux-2.107-3.el7.noarch                       4/4 

Installed:
  containerd.io.x86_64 0:1.2.13-3.1.el7     docker-ce.x86_64 3:19.03.7-3.el7    
  docker-ce-cli.x86_64 1:19.03.7-3.el7     

Dependency Installed:
  container-selinux.noarch 2:2.107-3.el7                                        

Complete!warning: /var/cache/yum/x86_64/7/updates/packages/device-mapper-1.02.158-2.el7_7.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-6.1810.2.el7.centos.x86_64 (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.2.13-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <docker@docker.com>"
 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
 From       : https://download.docker.com/linux/centos/gpg
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
Finished: SUCCESS
6月 082019
 

主机清单

Jenkins (18.163.103.73/Hong Kong)
Gitlab (45.32.95.186/Los Angeles)
www (45.77.85.36/Los Angeles)
client (136.244.67.202/London)

为已完成的Jenkins安装必要插件

Locale
This plugin lets you control the language of Jenkins.

Publish Over SSH
Send build artifacts over SSH

修改语言设置(强制显示英语)

配置git路径

Jenkins > Global Tool Configuration > Git
Path to Git executable /usr/sbin/git

为PHP项目Wordpress准备LAMP运行环境

查看系统原生PHP及MySQL版本

[root@www ~]# yum info php
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: repos-lax.psychz.net
 * extras: repos-lax.psychz.net
 * updates: repos-lax.psychz.net
Available Packages
Name        : php
Arch        : x86_64
Version     : 5.4.16
Release     : 46.1.el7_7
Size        : 1.4 M
Repo        : updates/7/x86_64
Summary     : PHP scripting language for creating dynamic web sites
URL         : http://www.php.net/
License     : PHP and Zend and BSD
Description : PHP is an HTML-embedded scripting language. PHP attempts to make
            : it easy for developers to write dynamically generated web pages.
            : PHP also offers built-in database integration for several
            : commercial and non-commercial database management systems, so
            : writing a database-enabled webpage with PHP is fairly simple. The
            : most common use of PHP coding is probably as a replacement for CGI
            : scripts.
            :
            : The php package contains the module (often referred to as mod_php)
            : which adds support for the PHP language to Apache HTTP Server.

[root@www ~]# yum info mariadb-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: repos-lax.psychz.net
 * extras: repos-lax.psychz.net
 * updates: repos-lax.psychz.net
Available Packages
Name        : mariadb-server
Arch        : x86_64
Epoch       : 1
Version     : 5.5.64
Release     : 1.el7
Size        : 11 M
Repo        : base/7/x86_64
Summary     : The MariaDB server and related files
URL         : http://mariadb.org
License     : GPLv2 with exceptions and LGPLv2 and BSD
Description : MariaDB is a multi-user, multi-threaded SQL database server. It is
            : a client/server implementation consisting of a server daemon
            : (mysqld) and many different client programs and libraries. This
            : package contains the MariaDB server and some accompanying files
            : and directories. MariaDB is a community developed branch of MySQL.

[root@www ~]#

配置PHP7.4 / MySQL 5.6环境

[root@www ~]# yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
[root@www ~]# yum makecache

[root@www ~]# yum -y install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
[root@www ~]# yum makecache

修改MySQL YUM仓库配置文件,启用MySQL5.6版本

[root@www ~]# vi /etc/yum.repos.d/mysql-community.repo
# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[root@www ~]# yum makecache

执行环境安装

[root@www ~]# yum install httpd php74-php php74-php-pdo php74-php-pecl-mysql php74-php-gd mysql-community-server mysql-community-client

查看php版本信息

[root@www ~]# php74 -v
PHP 7.4.3 (cli) (built: Feb 18 2020 11:53:05) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
[root@www ~]#

启动Apache服务

[root@www ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@www ~]# systemctl start httpd
[root@www ~]#

准备测试文件

[root@www ~]# echo "<?php phpinfo(); ?>" > /var/www/html/hello.php
[root@www ~]# cat /var/www/html/hello.php 
<?php phpinfo(); ?>
[root@www ~]#

使用浏览器访问测试文件

为Jenkins服务器指向域名

C:\Users\harveymei>ping gitlab.bcoc.site

正在 Ping gitlab.bcoc.site [45.32.95.186] 具有 32 字节的数据:
来自 45.32.95.186 的回复: 字节=32 时间=335ms TTL=44
来自 45.32.95.186 的回复: 字节=32 时间=327ms TTL=44
来自 45.32.95.186 的回复: 字节=32 时间=335ms TTL=44
来自 45.32.95.186 的回复: 字节=32 时间=336ms TTL=44

45.32.95.186 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 327ms,最长 = 336ms,平均 = 333ms

C:\Users\harveymei>

添加YUM仓库

[root@gitlab ~]# curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

执行安装

[root@gitlab ~]# sudo EXTERNAL_URL="https://gitlab.bcoc.site" yum install -y gitlab-ce

提示安装成功

Thank you for installing GitLab!
GitLab should be available at https://gitlab.bcoc.site

使用浏览器访问

配置代码仓库

新建仓库

获取基于https的仓库地址

https://gitlab.bcoc.site/root/wordpress.git

在客户端主机生成密钥对

[root@client ~]# ssh-keygen -t ed25519 -C "harvey.mei@linuxcache.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/root/.ssh/id_ed25519):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_ed25519.
Your public key has been saved in /root/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:pBZks0rE/4PCRggJjT+QoBjE2k3fK+kh0mc98/HgOvA harvey.mei@linuxcache.com
The key's randomart image is:
+--[ED25519 256]--+
|O* .. +          |
|Oo..oo o         |
|+= +.oo..        |
|. =.o.o+.        |
|   =. o=S.       |
|  . *.O B o      |
|   o * = * +     |
|      . E o .    |
|        .o       |
+----[SHA256]-----+
[root@client ~]# cat .ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPqeQy7qZvEEcpf+R35DRMB8nXR2nmET049/QJ+z0Qm/ harvey.mei@linuxcache.com
[root@client ~]#

在gitlab用户账户设置中配置密钥

导入公钥详情

安装git命令行工具

[root@client ~]# yum -y install git

克隆远程仓库到本地

[root@client ~]# git config --global user.name "Harvey"
[root@client ~]# git config --global user.email "harvey.mei@linuxcache.com"
[root@client ~]# git clone git@gitlab.bcoc.site:root/wordpress.git
Cloning into 'wordpress'...
The authenticity of host 'gitlab.bcoc.site (45.32.95.186)' can't be established.
ECDSA key fingerprint is SHA256:vhmKGmm/onEV47Xe7T4QOr8t8hRfqoJS1sj3WN/T8oc.
ECDSA key fingerprint is MD5:6e:d7:f6:eb:1d:ff:f4:cf:c6:e7:70:da:36:32:ee:26.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.bcoc.site,45.32.95.186' (ECDSA) to the list of known hosts.
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
[root@client ~]#

[root@client ~]# ls wordpress/
README.md
[root@client ~]#

下载Wordpress并解压至本地仓库目录

[root@client ~]# curl -O https://wordpress.org/latest.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11.8M  100 11.8M    0     0  8362k      0  0:00:01  0:00:01 --:--:-- 8361k
[root@client ~]# tar xzf latest.tar.gz
[root@client ~]# ls wordpress/
index.php        wp-admin              wp-cron.php        wp-mail.php
license.txt      wp-blog-header.php    wp-includes        wp-settings.php
readme.html      wp-comments-post.php  wp-links-opml.php  wp-signup.php
README.md        wp-config-sample.php  wp-load.php        wp-trackback.php
wp-activate.php  wp-content            wp-login.php       xmlrpc.php
[root@client ~]#

推送源代码至gitlab仓库

[root@client ~]# cd wordpress/
[root@client wordpress]# git add .
[root@client wordpress]# git commit -m "Wordpress 5.3.2"
[root@client wordpress]# git push -u origin master
Counting objects: 2124, done.
Compressing objects: 100% (2085/2085), done.
Writing objects: 100% (2123/2123), 12.10 MiB | 4.41 MiB/s, done.
Total 2123 (delta 213), reused 0 (delta 0)
remote: Resolving deltas: 100% (213/213), done.
To git@gitlab.bcoc.site:root/wordpress.git
   73d3e3f..c52a7e6  master -> master
Branch master set up to track remote branch master from origin.
[root@client wordpress]#

在Gitlab查看已推送的代码

配置Jenkins自动化任务

添加目标服务器及配置信息
Jenkins > Manage Jenkins > Configure System > SSH Servers > Add

配置Jenkins访问Gitlab服务器的账户鉴权
Jenkins > Credentials > System > Global credentials(unrestricted) > Add Credentials

新建任务(自由风格项目)

配置Gitlab仓库信息
Jenkisn > PHP > Source Code Management > Git

配置构建信息
Jenkins > PHP > Build > Send files or execute commands over SSH

执行构建任务
Jenkins > PHP > Build Now

查看任务的控制台输出

控制台输出文本信息

Started by user admin
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/PHP
using credential 13e0e649-fa87-4a60-8021-85276d986544
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@gitlab.bcoc.site:root/wordpress.git # timeout=10
Fetching upstream changes from git@gitlab.bcoc.site:root/wordpress.git
> git --version # timeout=10
using GIT_SSH to set credentials Gitlab Account
> git fetch --tags --progress git@gitlab.bcoc.site:root/wordpress.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision c52a7e62f3676005177293d706c9d902ee807d99 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f c52a7e62f3676005177293d706c9d902ee807d99 # timeout=10
Commit message: "Wordpress 5.3.2"
First time build. Skipping changelog.
SSH: Connecting from host [ip-172-31-32-243.ap-east-1.compute.internal]
SSH: Connecting with configuration [www] ...
SSH: EXEC: STDOUT/STDERR from command [exit 0] ...
SSH: EXEC: completed after 400 ms
SSH: Disconnecting configuration [www] ...
SSH: Transferred 1931 file(s)
Build step 'Send files or execute commands over SSH' changed build result to SUCCESS
Finished: SUCCESS

查看www服务器/var/www/html目录下部署的项目代码

使用浏览器访问

6月 082019
 

为jenkins服务配置域名指向

C:\Users\harveymei>ping jenkins.bcoc.site

正在 Ping jenkins.bcoc.site [18.162.148.195] 具有 32 字节的数据:
来自 18.162.148.195 的回复: 字节=32 时间=169ms TTL=46
来自 18.162.148.195 的回复: 字节=32 时间=153ms TTL=46
来自 18.162.148.195 的回复: 字节=32 时间=168ms TTL=46
来自 18.162.148.195 的回复: 字节=32 时间=167ms TTL=46

18.162.148.195 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 153ms,最长 = 169ms,平均 = 164ms

C:\Users\harveymei>

安装完成后启动jenkins服务并查看端口监听

[root@ip-172-31-40-41 ~]# service jenkins start
Starting jenkins (via systemctl):                          [  OK  ]
[root@ip-172-31-40-41 ~]# netstat -lnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::8080                 :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
[root@ip-172-31-40-41 ~]#

使用浏览器访问未启用SSL加密的Web控制台

申请Let’s Encrypt证书

[root@ip-172-31-40-41 ~]# yum -y install certbot
[root@ip-172-31-40-41 ~]# certbot certonly
Saving debug log to /var/log/letsencrypt/letsencrypt.log

How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): harvey.mei@linuxcache.com
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Starting new HTTPS connection (1): supporters.eff.org
Please enter in your domain name(s) (comma and/or space separated) (Enter 'c'
to cancel): jenkins.bcoc.site
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for jenkins.bcoc.site
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/jenkins.bcoc.site/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/jenkins.bcoc.site/privkey.pem
Your cert will expire on 2020-05-24. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le

[root@ip-172-31-40-41 ~]#

转换证书格式(使用certtool命令)

[root@ip-172-31-40-41 ~]# yum -y install gnutls-utils

[root@ip-172-31-40-41 ~]# rpm -lq gnutls-utils
/usr/bin/certtool
/usr/bin/crywrap
/usr/bin/danetool
/usr/bin/gnutls-cli
/usr/bin/gnutls-cli-debug
/usr/bin/gnutls-serv
/usr/bin/ocsptool
/usr/bin/p11tool
/usr/bin/psktool
/usr/bin/tpmtool
/usr/share/doc/gnutls-utils-3.3.29
/usr/share/doc/gnutls-utils-3.3.29/certtool.cfg
/usr/share/man/man1/certtool.1.gz
/usr/share/man/man1/danetool.1.gz
/usr/share/man/man1/gnutls-cli-debug.1.gz
/usr/share/man/man1/gnutls-cli.1.gz
/usr/share/man/man1/gnutls-serv.1.gz
/usr/share/man/man1/ocsptool.1.gz
/usr/share/man/man1/p11tool.1.gz
/usr/share/man/man1/psktool.1.gz
/usr/share/man/man1/tpmtool.1.gz
[root@ip-172-31-40-41 ~]#

合并证书公钥私钥为PKCS12格式并设置密码保护(123456)

certtool --to-p12 --load-privkey /etc/letsencrypt/live/jenkins.bcoc.site/privkey.pem \
--pkcs-cipher 3des-pkcs12 \
--load-certificate /etc/letsencrypt/live/jenkins.bcoc.site/fullchain.pem \
--outfile jenkins.p12 --outder

[root@ip-172-31-40-41 ~]# certtool --to-p12 --load-privkey /etc/letsencrypt/live/jenkins.bcoc.site/privkey.pem \
> --pkcs-cipher 3des-pkcs12 \
> --load-certificate /etc/letsencrypt/live/jenkins.bcoc.site/fullchain.pem \
> --outfile jenkins.p12 --outder
Generating a PKCS #12 structure...
Loading private key list...
Loaded 1 private keys.
Enter a name for the key: jenkins.bcoc.site
Enter password:
Confirm password:
[root@ip-172-31-40-41 ~]# ls
anaconda-ks.cfg jenkins.p12 original-ks.cfg
[root@ip-172-31-40-41 ~]#

转换PKCS12格式为JAVA支持的JKS格式

keytool -importkeystore -srckeystore jenkins.p12 \
-srcstorepass '123456' -srcstoretype PKCS12 \
-srcalias jenkins.bcoc.site -deststoretype JKS \
-destkeystore jenkins_keystore.jks \
-deststorepass '123456' -destalias jenkins.bcoc.site

[root@ip-172-31-40-41 ~]# keytool -importkeystore -srckeystore jenkins.p12 \
> -srcstorepass ‘123456’ -srcstoretype PKCS12 \
> -srcalias jenkins.bcoc.site -deststoretype JKS \
> -destkeystore jenkins_keystore.jks \
> -deststorepass ‘123456’ -destalias jenkins.bcoc.site
Importing keystore jenkins.p12 to jenkins_keystore.jks...
keytool error: java.io.IOException: keystore password was incorrect
[root@ip-172-31-40-41 ~]# keytool -importkeystore -srckeystore jenkins.p12 \
> -srcstorepass '123456' -srcstoretype PKCS12 \
> -srcalias jenkins.bcoc.site -deststoretype JKS \
> -destkeystore jenkins_keystore.jks \
> -deststorepass '123456' -destalias jenkins.bcoc.site
Importing keystore jenkins.p12 to jenkins_keystore.jks...

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore jenkins_keystore.jks -destkeystore jenkins_keystore.jks -deststoretype pkcs12".
[root@ip-172-31-40-41 ~]#
[root@ip-172-31-40-41 ~]# ls
anaconda-ks.cfg jenkins_keystore.jks jenkins.p12 original-ks.cfg
[root@ip-172-31-40-41 ~]#

修改证书文件属性

[root@ip-172-31-40-41 ~]# chown jenkins.jenkins jenkins_keystore.jks
[root@ip-172-31-40-41 ~]# chmod 600 jenkins_keystore.jks
[root@ip-172-31-40-41 ~]# mv jenkins_keystore.jks /var/lib/jenkins/
[root@ip-172-31-40-41 ~]#

修改jenins配置文件

[root@ip-172-31-40-41 ~]# vi /etc/sysconfig/jenkins

初始配置文件(SSL部分)

## Type: integer(0:65535)
## Default: ""
## ServiceRestart: jenkins
#
# HTTPS port Jenkins is listening on.
# Default is disabled.
#
JENKINS_HTTPS_PORT=""

## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# Path to the keystore in JKS format (as created by the JDK 'keytool').
# Default is disabled.
#
JENKINS_HTTPS_KEYSTORE=""

## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# Password to access the keystore defined in JENKINS_HTTPS_KEYSTORE.
# Default is disabled.
#
JENKINS_HTTPS_KEYSTORE_PASSWORD=""

## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for HTTPS requests.
# Default is disabled.
#
JENKINS_HTTPS_LISTEN_ADDRESS=""

修改

## Type: integer(0:65535)
## Default: ""
## ServiceRestart: jenkins
#
# HTTPS port Jenkins is listening on.
# Default is disabled.
#
JENKINS_HTTPS_PORT="8443"

## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# Path to the keystore in JKS format (as created by the JDK 'keytool').
# Default is disabled.
#
JENKINS_HTTPS_KEYSTORE="/var/lib/jenkins/jenkins_keystore.jks"

## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# Password to access the keystore defined in JENKINS_HTTPS_KEYSTORE.
# Default is disabled.
#
JENKINS_HTTPS_KEYSTORE_PASSWORD="123456"

## Type: string
## Default: ""
## ServiceRestart: jenkins
#
# IP address Jenkins listens on for HTTPS requests.
# Default is disabled.
#
JENKINS_HTTPS_LISTEN_ADDRESS="0.0.0.0"

禁用8080端口监听

初始配置文件

## Type: integer(0:65535)
## Default: 8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8080"

修改(禁用8080端口监听)

## Type: integer(0:65535)
## Default: 8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="-1"

重启服务并查看端口监听变化

[root@ip-172-31-40-41 ~]# service jenkins restart
Restarting jenkins (via systemctl):                        [  OK  ]
[root@ip-172-31-40-41 ~]# netstat -lnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp6       0      0 :::111                  :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
tcp6       0      0 :::8443                 :::*                    LISTEN     
[root@ip-172-31-40-41 ~]#

使用https协议及配置端口访问jenkins服务控制台

使用openssl命令合并公钥私钥为PKCS12命令用法

openssl pkcs12 -export -out jenkins.p12 \
-passout 'pass:123456' -inkey /etc/letsencrypt/live/jenkins.bcoc.site/privkey.pem \
-in /etc/letsencrypt/live/jenkins.bcoc.site/fullchain.pem \
-name jenkins.bcoc.site
5月 242019
 

官方Yum仓库地址

https://pkg.jenkins.io/redhat-stable/

安装Jenkin LTS版本的Yum仓库源

[root@iZj6cehstgjoj3qav88fidZ ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
--2019-06-12 18:27:21-- 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

2019-06-12 18:27:22 (19.3 MB/s) - ‘/etc/yum.repos.d/jenkins.repo’ saved [85/85]

[root@iZj6cehstgjoj3qav88fidZ ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
[root@iZj6cehstgjoj3qav88fidZ ~]#

安装OpenJDK环境并查看版本信息
[root@iZj6cehstgjoj3qav88fidZ ~]# yum install java-1.8.0-openjdk
[root@iZj6cehstgjoj3qav88fidZ ~]# java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
[root@iZj6cehstgjoj3qav88fidZ ~]#

使用Yum源安装Jenkins服务

[root@iZj6cehstgjoj3qav88fidZ ~]# yum install jenkins

查看安装路径

[root@iZj6cehstgjoj3qav88fidZ ~]# rpm -lq jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins
/usr/lib/jenkins
/usr/lib/jenkins/jenkins.war
/usr/sbin/rcjenkins
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins
[root@iZj6cehstgjoj3qav88fidZ ~]#

查看Jenkins服务注册信息

[root@iZj6cehstgjoj3qav88fidZ ~]# chkconfig --list jenkins

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.

jenkins 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@iZj6cehstgjoj3qav88fidZ ~]#

启动服务

[root@iZj6cehstgjoj3qav88fidZ ~]# service jenkins start
Starting jenkins (via systemctl): [ OK ]
[root@iZj6cehstgjoj3qav88fidZ ~]#

查看监听

使用浏览器访问

查看初始密码

[root@iZj6cehstgjoj3qav88fidZ ~]# cat /var/lib/jenkins/secrets/initialAdminPassword
5228940ac30a481d97a4efbabe4147a3
[root@iZj6cehstgjoj3qav88fidZ ~]#

安装推荐的插件

插件安装过程

创建第一个管理员用户

实例配置

安装完成

控制台首页