什么是CI/CD
持续集成(Continuous Integration,CI):代码合并、构建、部署、测试都在一起,不断地执行这个过程,并对结果反馈。
持续部署(Continuous Deployment,CD):部署到测试环境、预生产环境、生产环境。
持续交付(Continuous Delivery,CD):将最终产品发布到生产环境,给用户使用。
高效的CI/CD环境可以获得:
• 及时发现问题
• 大幅度减少故障率
• 加快迭代速度
• 减少时间成本
接下来是实战:
环境说明:
192.168.1.30 上面安装 docker, harbor,git (上面已经安装好了 docker, harbor,)
192.168.1.40 上面安装 docker, jenkins,
步骤从这里开始:
1. 192.168.1.40(docker, jenkins) 上安装好基础环境,参考文档
(Docker:测试环境的准备-建立一台centos测试机,Docker:测试环境的准备-centos7上安装docker)
[BEGIN] 2019/3/21 11:04:25 [root@192 ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config [root@192 ~]# setenforce 0 [root@192 ~]# systemctl stop firewalld [root@192 ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@192 ~]# yum install -y yum-utils \ > device-mapper-persistent-data \ > lvm2 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.cn99.com * updates: mirrors.huaweicloud.com Package yum-utils-1.1.31-50.el7.noarch already installed and latest version Package device-mapper-persistent-data-0.7.3-3.el7.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package lvm2.x86_64 7:2.02.180-8.el7 will be updated ---> Package lvm2.x86_64 7:2.02.180-10.el7_6.3 will be an update --> Processing Dependency: lvm2-libs = 7:2.02.180-10.el7_6.3 for package: 7:lvm2-2.02.180-10.el7_6.3.x86_64 --> Running transaction check ---> Package lvm2-libs.x86_64 7:2.02.180-8.el7 will be updated ---> Package lvm2-libs.x86_64 7:2.02.180-10.el7_6.3 will be an update --> Processing Dependency: device-mapper-event = 7:1.02.149-10.el7_6.3 for package: 7:lvm2-libs-2.02.180-10.el7_6.3.x86_64 --> Running transaction check ---> Package device-mapper-event.x86_64 7:1.02.149-8.el7 will be updated ---> Package device-mapper-event.x86_64 7:1.02.149-10.el7_6.3 will be an update --> Processing Dependency: device-mapper-event-libs = 7:1.02.149-10.el7_6.3 for package: 7:device-mapper-event-1.02.149-10.el7_6.3.x86_64 --> Processing Dependency: device-mapper = 7:1.02.149-10.el7_6.3 for package: 7:device-mapper-event-1.02.149-10.el7_6.3.x86_64 --> Running transaction check ---> Package device-mapper.x86_64 7:1.02.149-8.el7 will be updated --> Processing Dependency: device-mapper = 7:1.02.149-8.el7 for package: 7:device-mapper-libs-1.02.149-8.el7.x86_64 ---> Package device-mapper.x86_64 7:1.02.149-10.el7_6.3 will be an update ---> Package device-mapper-event-libs.x86_64 7:1.02.149-8.el7 will be updated ---> Package device-mapper-event-libs.x86_64 7:1.02.149-10.el7_6.3 will be an update --> Running transaction check ---> Package device-mapper-libs.x86_64 7:1.02.149-8.el7 will be updated ---> Package device-mapper-libs.x86_64 7:1.02.149-10.el7_6.3 will be an update --> Finished Dependency Resolution Dependencies Resolved =============================================================================================== Package Arch Version Repository Size =============================================================================================== Updating: lvm2 x86_64 7:2.02.180-10.el7_6.3 updates 1.3 M Updating for dependencies: device-mapper x86_64 7:1.02.149-10.el7_6.3 updates 292 k device-mapper-event x86_64 7:1.02.149-10.el7_6.3 updates 188 k device-mapper-event-libs x86_64 7:1.02.149-10.el7_6.3 updates 188 k device-mapper-libs x86_64 7:1.02.149-10.el7_6.3 updates 320 k lvm2-libs x86_64 7:2.02.180-10.el7_6.3 updates 1.1 M Transaction Summary =============================================================================================== Upgrade 1 Package (+5 Dependent packages) Total download size: 3.3 M Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/6): device-mapper-event-1.02.149-10.el7_6.3.x86_64.rpm | 188 kB 00:00:00 (2/6): device-mapper-1.02.149-10.el7_6.3.x86_64.rpm | 292 kB 00:00:00 (3/6): device-mapper-event-libs-1.02.149-10.el7_6.3.x86_64.rpm | 188 kB 00:00:00 (4/6): device-mapper-libs-1.02.149-10.el7_6.3.x86_64.rpm | 320 kB 00:00:00 (5/6): lvm2-libs-2.02.180-10.el7_6.3.x86_64.rpm | 1.1 MB 00:00:00 (6/6): lvm2-2.02.180-10.el7_6.3.x86_64.rpm | 1.3 MB 00:00:00 ----------------------------------------------------------------------------------------------- Total 5.0 MB/s | 3.3 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : 7:device-mapper-1.02.149-10.el7_6.3.x86_64 1/12 Updating : 7:device-mapper-libs-1.02.149-10.el7_6.3.x86_64 2/12 Updating : 7:device-mapper-event-libs-1.02.149-10.el7_6.3.x86_64 3/12 Updating : 7:device-mapper-event-1.02.149-10.el7_6.3.x86_64 4/12 Updating : 7:lvm2-libs-2.02.180-10.el7_6.3.x86_64 5/12 Updating : 7:lvm2-2.02.180-10.el7_6.3.x86_64 6/12 Cleanup : 7:lvm2-2.02.180-8.el7.x86_64 7/12 Cleanup : 7:lvm2-libs-2.02.180-8.el7.x86_64 8/12 Cleanup : 7:device-mapper-event-1.02.149-8.el7.x86_64 9/12 Cleanup : 7:device-mapper-event-libs-1.02.149-8.el7.x86_64 10/12 Cleanup : 7:device-mapper-1.02.149-8.el7.x86_64 11/12 Cleanup : 7:device-mapper-libs-1.02.149-8.el7.x86_64 12/12 Verifying : 7:device-mapper-libs-1.02.149-10.el7_6.3.x86_64 1/12 Verifying : 7:device-mapper-event-libs-1.02.149-10.el7_6.3.x86_64 2/12 Verifying : 7:device-mapper-1.02.149-10.el7_6.3.x86_64 3/12 Verifying : 7:device-mapper-event-1.02.149-10.el7_6.3.x86_64 4/12 Verifying : 7:lvm2-libs-2.02.180-10.el7_6.3.x86_64 5/12 Verifying : 7:lvm2-2.02.180-10.el7_6.3.x86_64 6/12 Verifying : 7:lvm2-2.02.180-8.el7.x86_64 7/12 Verifying : 7:device-mapper-event-1.02.149-8.el7.x86_64 8/12 Verifying : 7:lvm2-libs-2.02.180-8.el7.x86_64 9/12 Verifying : 7:device-mapper-libs-1.02.149-8.el7.x86_64 10/12 Verifying : 7:device-mapper-1.02.149-8.el7.x86_64 11/12 Verifying : 7:device-mapper-event-libs-1.02.149-8.el7.x86_64 12/12 Updated: lvm2.x86_64 7:2.02.180-10.el7_6.3 Dependency Updated: device-mapper.x86_64 7:1.02.149-10.el7_6.3 device-mapper-event.x86_64 7:1.02.149-10.el7_6.3 device-mapper-event-libs.x86_64 7:1.02.149-10.el7_6.3 device-mapper-libs.x86_64 7:1.02.149-10.el7_6.3 lvm2-libs.x86_64 7:2.02.180-10.el7_6.3 Complete! [root@192 ~]# yum-config-manager \ > --add-repo \ > https://download.docker.com/linux/centos/docker-ce.repo 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 [root@192 ~]# yum install docker-ce -y Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.cn99.com * updates: mirrors.huaweicloud.com docker-ce-stable | 3.5 kB 00:00:00 (1/2): docker-ce-stable/x86_64/primary_db | 25 kB 00:00:00 (2/2): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00 Resolving Dependencies --> Running transaction check ---> Package docker-ce.x86_64 3:18.09.3-3.el7 will be installed --> Processing Dependency: container-selinux >= 2.9 for package: 3:docker-ce-18.09.3-3.el7.x86_64 --> Processing Dependency: containerd.io >= 1.2.2-3 for package: 3:docker-ce-18.09.3-3.el7.x86_64 --> Processing Dependency: libseccomp >= 2.3 for package: 3:docker-ce-18.09.3-3.el7.x86_64 --> Processing Dependency: docker-ce-cli for package: 3:docker-ce-18.09.3-3.el7.x86_64 --> Processing Dependency: libcgroup for package: 3:docker-ce-18.09.3-3.el7.x86_64 --> Processing Dependency: libseccomp.so.2()(64bit) for package: 3:docker-ce-18.09.3-3.el7.x86_64 --> Running transaction check ---> Package container-selinux.noarch 2:2.74-1.el7 will be installed --> Processing Dependency: policycoreutils-python for package: 2:container-selinux-2.74-1.el7.noarch ---> Package containerd.io.x86_64 0:1.2.4-3.1.el7 will be installed ---> Package docker-ce-cli.x86_64 1:18.09.3-3.el7 will be installed ---> Package libcgroup.x86_64 0:0.41-20.el7 will be installed ---> Package libseccomp.x86_64 0:2.3.1-3.el7 will be installed --> Running transaction check ---> Package policycoreutils-python.x86_64 0:2.5-29.el7_6.1 will be installed --> Processing Dependency: policycoreutils = 2.5-29.el7_6.1 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-29.el7_6.1.x86_64 --> Running transaction check ---> Package audit-libs-python.x86_64 0:2.8.4-4.el7 will be installed ---> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed ---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed ---> Package policycoreutils.x86_64 0:2.5-29.el7 will be updated ---> Package policycoreutils.x86_64 0:2.5-29.el7_6.1 will be an update ---> Package python-IPy.noarch 0:0.75-6.el7 will be installed ---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =============================================================================================== Package Arch Version Repository Size =============================================================================================== Installing: docker-ce x86_64 3:18.09.3-3.el7 docker-ce-stable 19 M Installing for dependencies: audit-libs-python x86_64 2.8.4-4.el7 base 76 k checkpolicy x86_64 2.5-8.el7 base 295 k container-selinux noarch 2:2.74-1.el7 extras 38 k containerd.io x86_64 1.2.4-3.1.el7 docker-ce-stable 22 M docker-ce-cli x86_64 1:18.09.3-3.el7 docker-ce-stable 14 M libcgroup x86_64 0.41-20.el7 base 66 k libseccomp x86_64 2.3.1-3.el7 base 56 k libsemanage-python x86_64 2.5-14.el7 base 113 k policycoreutils-python x86_64 2.5-29.el7_6.1 updates 456 k python-IPy noarch 0.75-6.el7 base 32 k setools-libs x86_64 3.3.8-4.el7 base 620 k Updating for dependencies: policycoreutils x86_64 2.5-29.el7_6.1 updates 916 k Transaction Summary =============================================================================================== Install 1 Package (+11 Dependent packages) Upgrade ( 1 Dependent package) Total download size: 57 M Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/13): container-selinux-2.74-1.el7.noarch.rpm | 38 kB 00:00:00 (2/13): checkpolicy-2.5-8.el7.x86_64.rpm | 295 kB 00:00:02 (3/13): audit-libs-python-2.8.4-4.el7.x86_64.rpm | 76 kB 00:00:02 warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-ce-18.09.3-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY Public key for docker-ce-18.09.3-3.el7.x86_64.rpm is not installed (4/13): docker-ce-18.09.3-3.el7.x86_64.rpm | 19 MB 00:00:04 (5/13): libcgroup-0.41-20.el7.x86_64.rpm | 66 kB 00:00:00 (6/13): libsemanage-python-2.5-14.el7.x86_64.rpm | 113 kB 00:00:00 (7/13): containerd.io-1.2.4-3.1.el7.x86_64.rpm | 22 MB 00:00:05 (8/13): policycoreutils-2.5-29.el7_6.1.x86_64.rpm | 916 kB 00:00:00 (9/13): python-IPy-0.75-6.el7.noarch.rpm | 32 kB 00:00:00 (10/13): setools-libs-3.3.8-4.el7.x86_64.rpm | 620 kB 00:00:00 (11/13): policycoreutils-python-2.5-29.el7_6.1.x86_64.rpm | 456 kB 00:00:00 (12/13): libseccomp-2.3.1-3.el7.x86_64.rpm | 56 kB 00:00:02 (13/13): docker-ce-cli-18.09.3-3.el7.x86_64.rpm | 14 MB 00:00:04 ----------------------------------------------------------------------------------------------- Total 6.2 MB/s | 57 MB 00:00:09 Retrieving key from https://download.docker.com/linux/centos/gpg Importing GPG key 0x621E9F35: Userid : "Docker Release (CE rpm)" Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35 From : https://download.docker.com/linux/centos/gpg Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : policycoreutils-2.5-29.el7_6.1.x86_64 1/14 Installing : libcgroup-0.41-20.el7.x86_64 2/14 Installing : setools-libs-3.3.8-4.el7.x86_64 3/14 Installing : containerd.io-1.2.4-3.1.el7.x86_64 4/14 Installing : python-IPy-0.75-6.el7.noarch 5/14 Installing : checkpolicy-2.5-8.el7.x86_64 6/14 Installing : libseccomp-2.3.1-3.el7.x86_64 7/14 Installing : libsemanage-python-2.5-14.el7.x86_64 8/14 Installing : audit-libs-python-2.8.4-4.el7.x86_64 9/14 Installing : policycoreutils-python-2.5-29.el7_6.1.x86_64 10/14 Installing : 2:container-selinux-2.74-1.el7.noarch 11/14 Installing : 1:docker-ce-cli-18.09.3-3.el7.x86_64 12/14 Installing : 3:docker-ce-18.09.3-3.el7.x86_64 13/14 Cleanup : policycoreutils-2.5-29.el7.x86_64 14/14 Verifying : libcgroup-0.41-20.el7.x86_64 1/14 Verifying : policycoreutils-python-2.5-29.el7_6.1.x86_64 2/14 Verifying : 1:docker-ce-cli-18.09.3-3.el7.x86_64 3/14 Verifying : audit-libs-python-2.8.4-4.el7.x86_64 4/14 Verifying : libsemanage-python-2.5-14.el7.x86_64 5/14 Verifying : libseccomp-2.3.1-3.el7.x86_64 6/14 Verifying : checkpolicy-2.5-8.el7.x86_64 7/14 Verifying : python-IPy-0.75-6.el7.noarch 8/14 Verifying : 2:container-selinux-2.74-1.el7.noarch 9/14 Verifying : policycoreutils-2.5-29.el7_6.1.x86_64 10/14 Verifying : 3:docker-ce-18.09.3-3.el7.x86_64 11/14 Verifying : containerd.io-1.2.4-3.1.el7.x86_64 12/14 Verifying : setools-libs-3.3.8-4.el7.x86_64 13/14 Verifying : policycoreutils-2.5-29.el7.x86_64 14/14 Installed: docker-ce.x86_64 3:18.09.3-3.el7 Dependency Installed: audit-libs-python.x86_64 0:2.8.4-4.el7 checkpolicy.x86_64 0:2.5-8.el7 container-selinux.noarch 2:2.74-1.el7 containerd.io.x86_64 0:1.2.4-3.1.el7 docker-ce-cli.x86_64 1:18.09.3-3.el7 libcgroup.x86_64 0:0.41-20.el7 libseccomp.x86_64 0:2.3.1-3.el7 libsemanage-python.x86_64 0:2.5-14.el7 policycoreutils-python.x86_64 0:2.5-29.el7_6.1 python-IPy.noarch 0:0.75-6.el7 setools-libs.x86_64 0:3.3.8-4.el7 Dependency Updated: policycoreutils.x86_64 0:2.5-29.el7_6.1 Complete! [root@192 ~]# systemctl start docker [root@192 ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io docker version >= 1.12 {"registry-mirrors": ["http://f1361db2.m.daocloud.io"]} Success. You need to restart docker to take effect: sudo systemctl restart docker [root@192 ~]# systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. [root@192 ~]# systemctl restart docker [END] 2019/3/21 11:18:25
2. 192.168.1.30 上面安装git代码管理版本仓库
[BEGIN] 2019/3/21 11:21:12
#本地创建一个git用户 [root@192 ~]# useradd git [root@192 ~]# passwd git 更改用户 git 的密码 。 新的 密码: 无效的密码: 密码未通过字典检查 - 过于简单化/系统化 重新输入新的 密码: passwd:所有的身份验证令牌已经成功更新。
#安装git代码管理仓库 [root@192 ~]# yum install git -y 已加载插件:fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: centos.ustc.edu.cn * updates: mirrors.aliyun.com base | 3.6 kB 00:00:00 docker-ce-stable | 3.5 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/2): updates/7/x86_64/primary_db | 3.3 MB 00:00:00 (2/2): extras/7/x86_64/primary_db | 187 kB 00:00:06 正在解决依赖关系 --> 正在检查事务 ---> 软件包 git.x86_64.0.1.8.3.1-20.el7 将被 安装 --> 正在处理依赖关系 perl-Git = 1.8.3.1-20.el7,它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl >= 5.008,它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 rsync,它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(warnings),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(vars),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(strict),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(lib),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(Term::ReadKey),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(Git),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(Getopt::Long),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(File::stat),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(File::Temp),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(File::Spec),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(File::Path),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(File::Find),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(File::Copy),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(File::Basename),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(Exporter),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 perl(Error),它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在处理依赖关系 /usr/bin/perl,它被软件包 git-1.8.3.1-20.el7.x86_64 需要 --> 正在检查事务 ---> 软件包 perl.x86_64.4.5.16.3-294.el7_6 将被 安装 --> 正在处理依赖关系 perl-libs = 4:5.16.3-294.el7_6,它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Socket) >= 1.3,它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Scalar::Util) >= 1.10,它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl-macros,它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl-libs,它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(threads::shared),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(threads),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(constant),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Time::Local),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Time::HiRes),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Storable),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Socket),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Scalar::Util),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Pod::Simple::XHTML),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Pod::Simple::Search),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Filter::Util::Call),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 perl(Carp),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 --> 正在处理依赖关系 libperl.so()(64bit),它被软件包 4:perl-5.16.3-294.el7_6.x86_64 需要 ---> 软件包 perl-Error.noarch.1.0.17020-2.el7 将被 安装 ---> 软件包 perl-Exporter.noarch.0.5.68-3.el7 将被 安装 ---> 软件包 perl-File-Path.noarch.0.2.09-2.el7 将被 安装 ---> 软件包 perl-File-Temp.noarch.0.0.23.01-3.el7 将被 安装 ---> 软件包 perl-Getopt-Long.noarch.0.2.40-3.el7 将被 安装 --> 正在处理依赖关系 perl(Pod::Usage) >= 1.14,它被软件包 perl-Getopt-Long-2.40-3.el7.noarch 需要 --> 正在处理依赖关系 perl(Text::ParseWords),它被软件包 perl-Getopt-Long-2.40-3.el7.noarch 需要 ---> 软件包 perl-Git.noarch.0.1.8.3.1-20.el7 将被 安装 ---> 软件包 perl-PathTools.x86_64.0.3.40-5.el7 将被 安装 ---> 软件包 perl-TermReadKey.x86_64.0.2.30-20.el7 将被 安装 ---> 软件包 rsync.x86_64.0.3.1.2-4.el7 将被 安装 --> 正在检查事务 ---> 软件包 perl-Carp.noarch.0.1.26-244.el7 将被 安装 ---> 软件包 perl-Filter.x86_64.0.1.49-3.el7 将被 安装 ---> 软件包 perl-Pod-Simple.noarch.1.3.28-4.el7 将被 安装 --> 正在处理依赖关系 perl(Pod::Escapes) >= 1.04,它被软件包 1:perl-Pod-Simple-3.28-4.el7.noarch 需要 --> 正在处理依赖关系 perl(Encode),它被软件包 1:perl-Pod-Simple-3.28-4.el7.noarch 需要 ---> 软件包 perl-Pod-Usage.noarch.0.1.63-3.el7 将被 安装 --> 正在处理依赖关系 perl(Pod::Text) >= 3.15,它被软件包 perl-Pod-Usage-1.63-3.el7.noarch 需要 --> 正在处理依赖关系 perl-Pod-Perldoc,它被软件包 perl-Pod-Usage-1.63-3.el7.noarch 需要 ---> 软件包 perl-Scalar-List-Utils.x86_64.0.1.27-248.el7 将被 安装 ---> 软件包 perl-Socket.x86_64.0.2.010-4.el7 将被 安装 ---> 软件包 perl-Storable.x86_64.0.2.45-3.el7 将被 安装 ---> 软件包 perl-Text-ParseWords.noarch.0.3.29-4.el7 将被 安装 ---> 软件包 perl-Time-HiRes.x86_64.4.1.9725-3.el7 将被 安装 ---> 软件包 perl-Time-Local.noarch.0.1.2300-2.el7 将被 安装 ---> 软件包 perl-constant.noarch.0.1.27-2.el7 将被 安装 ---> 软件包 perl-libs.x86_64.4.5.16.3-294.el7_6 将被 安装 ---> 软件包 perl-macros.x86_64.4.5.16.3-294.el7_6 将被 安装 ---> 软件包 perl-threads.x86_64.0.1.87-4.el7 将被 安装 ---> 软件包 perl-threads-shared.x86_64.0.1.43-6.el7 将被 安装 --> 正在检查事务 ---> 软件包 perl-Encode.x86_64.0.2.51-7.el7 将被 安装 ---> 软件包 perl-Pod-Escapes.noarch.1.1.04-294.el7_6 将被 安装 ---> 软件包 perl-Pod-Perldoc.noarch.0.3.20-4.el7 将被 安装 --> 正在处理依赖关系 perl(parent),它被软件包 perl-Pod-Perldoc-3.20-4.el7.noarch 需要 --> 正在处理依赖关系 perl(HTTP::Tiny),它被软件包 perl-Pod-Perldoc-3.20-4.el7.noarch 需要 ---> 软件包 perl-podlators.noarch.0.2.5.1-3.el7 将被 安装 --> 正在检查事务 ---> 软件包 perl-HTTP-Tiny.noarch.0.0.033-3.el7 将被 安装 ---> 软件包 perl-parent.noarch.1.0.225-244.el7 将被 安装 --> 解决依赖关系完成 依赖关系解决 =============================================================================================== Package 架构 版本 源 大小 =============================================================================================== 正在安装: git x86_64 1.8.3.1-20.el7 updates 4.4 M 为依赖而安装: perl x86_64 4:5.16.3-294.el7_6 updates 8.0 M perl-Carp noarch 1.26-244.el7 base 19 k perl-Encode x86_64 2.51-7.el7 base 1.5 M perl-Error noarch 1:0.17020-2.el7 base 32 k perl-Exporter noarch 5.68-3.el7 base 28 k perl-File-Path noarch 2.09-2.el7 base 26 k perl-File-Temp noarch 0.23.01-3.el7 base 56 k perl-Filter x86_64 1.49-3.el7 base 76 k perl-Getopt-Long noarch 2.40-3.el7 base 56 k perl-Git noarch 1.8.3.1-20.el7 updates 55 k perl-HTTP-Tiny noarch 0.033-3.el7 base 38 k perl-PathTools x86_64 3.40-5.el7 base 82 k perl-Pod-Escapes noarch 1:1.04-294.el7_6 updates 51 k perl-Pod-Perldoc noarch 3.20-4.el7 base 87 k perl-Pod-Simple noarch 1:3.28-4.el7 base 216 k perl-Pod-Usage noarch 1.63-3.el7 base 27 k perl-Scalar-List-Utils x86_64 1.27-248.el7 base 36 k perl-Socket x86_64 2.010-4.el7 base 49 k perl-Storable x86_64 2.45-3.el7 base 77 k perl-TermReadKey x86_64 2.30-20.el7 base 31 k perl-Text-ParseWords noarch 3.29-4.el7 base 14 k perl-Time-HiRes x86_64 4:1.9725-3.el7 base 45 k perl-Time-Local noarch 1.2300-2.el7 base 24 k perl-constant noarch 1.27-2.el7 base 19 k perl-libs x86_64 4:5.16.3-294.el7_6 updates 688 k perl-macros x86_64 4:5.16.3-294.el7_6 updates 44 k perl-parent noarch 1:0.225-244.el7 base 12 k perl-podlators noarch 2.5.1-3.el7 base 112 k perl-threads x86_64 1.87-4.el7 base 49 k perl-threads-shared x86_64 1.43-6.el7 base 39 k rsync x86_64 3.1.2-4.el7 base 403 k 事务概要 =============================================================================================== 安装 1 软件包 (+31 依赖软件包) 总下载量:16 M 安装大小:59 M Downloading packages: (1/32): perl-Carp-1.26-244.el7.noarch.rpm | 19 kB 00:00:00 (2/32): perl-Error-0.17020-2.el7.noarch.rpm | 32 kB 00:00:00 (3/32): perl-Exporter-5.68-3.el7.noarch.rpm | 28 kB 00:00:00 (4/32): perl-Encode-2.51-7.el7.x86_64.rpm | 1.5 MB 00:00:00 (5/32): perl-File-Temp-0.23.01-3.el7.noarch.rpm | 56 kB 00:00:00 (6/32): perl-Filter-1.49-3.el7.x86_64.rpm | 76 kB 00:00:00 (7/32): perl-Getopt-Long-2.40-3.el7.noarch.rpm | 56 kB 00:00:00 (8/32): git-1.8.3.1-20.el7.x86_64.rpm | 4.4 MB 00:00:01 (9/32): perl-Git-1.8.3.1-20.el7.noarch.rpm | 55 kB 00:00:00 (10/32): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm | 38 kB 00:00:00 (11/32): perl-PathTools-3.40-5.el7.x86_64.rpm | 82 kB 00:00:00 (12/32): perl-File-Path-2.09-2.el7.noarch.rpm | 26 kB 00:00:00 (13/32): perl-Pod-Escapes-1.04-294.el7_6.noarch.rpm | 51 kB 00:00:00 (14/32): perl-Pod-Simple-3.28-4.el7.noarch.rpm | 216 kB 00:00:00 (15/32): perl-5.16.3-294.el7_6.x86_64.rpm | 8.0 MB 00:00:02 (16/32): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm | 87 kB 00:00:00 (17/32): perl-Pod-Usage-1.63-3.el7.noarch.rpm | 27 kB 00:00:00 (18/32): perl-Socket-2.010-4.el7.x86_64.rpm | 49 kB 00:00:00 (19/32): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm | 36 kB 00:00:00 (20/32): perl-TermReadKey-2.30-20.el7.x86_64.rpm | 31 kB 00:00:00 (21/32): perl-Text-ParseWords-3.29-4.el7.noarch.rpm | 14 kB 00:00:00 (22/32): perl-Storable-2.45-3.el7.x86_64.rpm | 77 kB 00:00:01 (23/32): perl-Time-HiRes-1.9725-3.el7.x86_64.rpm | 45 kB 00:00:01 (24/32): perl-constant-1.27-2.el7.noarch.rpm | 19 kB 00:00:00 (25/32): perl-parent-0.225-244.el7.noarch.rpm | 12 kB 00:00:00 (26/32): perl-Time-Local-1.2300-2.el7.noarch.rpm | 24 kB 00:00:01 (27/32): perl-podlators-2.5.1-3.el7.noarch.rpm | 112 kB 00:00:00 (28/32): perl-macros-5.16.3-294.el7_6.x86_64.rpm | 44 kB 00:00:00 (29/32): perl-libs-5.16.3-294.el7_6.x86_64.rpm | 688 kB 00:00:00 (30/32): perl-threads-1.87-4.el7.x86_64.rpm | 49 kB 00:00:01 (31/32): perl-threads-shared-1.43-6.el7.x86_64.rpm | 39 kB 00:00:01 (32/32): rsync-3.1.2-4.el7.x86_64.rpm | 403 kB 00:00:00 ----------------------------------------------------------------------------------------------- 总计 2.3 MB/s | 16 MB 00:00:07 Running transaction check Running transaction test Transaction test succeeded Running transaction 正在安装 : 1:perl-parent-0.225-244.el7.noarch 1/32 正在安装 : perl-HTTP-Tiny-0.033-3.el7.noarch 2/32 正在安装 : perl-podlators-2.5.1-3.el7.noarch 3/32 正在安装 : perl-Pod-Perldoc-3.20-4.el7.noarch 4/32 正在安装 : 1:perl-Pod-Escapes-1.04-294.el7_6.noarch 5/32 正在安装 : perl-Encode-2.51-7.el7.x86_64 6/32 正在安装 : perl-Text-ParseWords-3.29-4.el7.noarch 7/32 正在安装 : perl-Pod-Usage-1.63-3.el7.noarch 8/32 正在安装 : 4:perl-libs-5.16.3-294.el7_6.x86_64 9/32 正在安装 : 4:perl-macros-5.16.3-294.el7_6.x86_64 10/32 正在安装 : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 11/32 正在安装 : perl-Exporter-5.68-3.el7.noarch 12/32 正在安装 : perl-constant-1.27-2.el7.noarch 13/32 正在安装 : perl-Time-Local-1.2300-2.el7.noarch 14/32 正在安装 : perl-Socket-2.010-4.el7.x86_64 15/32 正在安装 : perl-Carp-1.26-244.el7.noarch 16/32 正在安装 : perl-Storable-2.45-3.el7.x86_64 17/32 正在安装 : perl-PathTools-3.40-5.el7.x86_64 18/32 正在安装 : perl-Scalar-List-Utils-1.27-248.el7.x86_64 19/32 正在安装 : 1:perl-Pod-Simple-3.28-4.el7.noarch 20/32 正在安装 : perl-File-Temp-0.23.01-3.el7.noarch 21/32 正在安装 : perl-File-Path-2.09-2.el7.noarch 22/32 正在安装 : perl-threads-shared-1.43-6.el7.x86_64 23/32 正在安装 : perl-threads-1.87-4.el7.x86_64 24/32 正在安装 : perl-Filter-1.49-3.el7.x86_64 25/32 正在安装 : perl-Getopt-Long-2.40-3.el7.noarch 26/32 正在安装 : 4:perl-5.16.3-294.el7_6.x86_64 27/32 正在安装 : 1:perl-Error-0.17020-2.el7.noarch 28/32 正在安装 : perl-TermReadKey-2.30-20.el7.x86_64 29/32 正在安装 : rsync-3.1.2-4.el7.x86_64 30/32 正在安装 : perl-Git-1.8.3.1-20.el7.noarch 31/32 正在安装 : git-1.8.3.1-20.el7.x86_64 32/32 验证中 : perl-HTTP-Tiny-0.033-3.el7.noarch 1/32 验证中 : perl-threads-shared-1.43-6.el7.x86_64 2/32 验证中 : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 3/32 验证中 : 1:perl-Pod-Escapes-1.04-294.el7_6.noarch 4/32 验证中 : perl-Exporter-5.68-3.el7.noarch 5/32 验证中 : perl-constant-1.27-2.el7.noarch 6/32 验证中 : perl-PathTools-3.40-5.el7.x86_64 7/32 验证中 : 1:perl-parent-0.225-244.el7.noarch 8/32 验证中 : perl-TermReadKey-2.30-20.el7.x86_64 9/32 验证中 : 4:perl-libs-5.16.3-294.el7_6.x86_64 10/32 验证中 : perl-File-Temp-0.23.01-3.el7.noarch 11/32 验证中 : 1:perl-Pod-Simple-3.28-4.el7.noarch 12/32 验证中 : perl-Time-Local-1.2300-2.el7.noarch 13/32 验证中 : 4:perl-macros-5.16.3-294.el7_6.x86_64 14/32 验证中 : perl-Socket-2.010-4.el7.x86_64 15/32 验证中 : perl-Carp-1.26-244.el7.noarch 16/32 验证中 : 1:perl-Error-0.17020-2.el7.noarch 17/32 验证中 : git-1.8.3.1-20.el7.x86_64 18/32 验证中 : perl-Storable-2.45-3.el7.x86_64 19/32 验证中 : perl-Scalar-List-Utils-1.27-248.el7.x86_64 20/32 验证中 : perl-Git-1.8.3.1-20.el7.noarch 21/32 验证中 : rsync-3.1.2-4.el7.x86_64 22/32 验证中 : perl-Pod-Usage-1.63-3.el7.noarch 23/32 验证中 : perl-Encode-2.51-7.el7.x86_64 24/32 验证中 : perl-Pod-Perldoc-3.20-4.el7.noarch 25/32 验证中 : perl-podlators-2.5.1-3.el7.noarch 26/32 验证中 : perl-File-Path-2.09-2.el7.noarch 27/32 验证中 : perl-threads-1.87-4.el7.x86_64 28/32 验证中 : perl-Filter-1.49-3.el7.x86_64 29/32 验证中 : perl-Getopt-Long-2.40-3.el7.noarch 30/32 验证中 : perl-Text-ParseWords-3.29-4.el7.noarch 31/32 验证中 : 4:perl-5.16.3-294.el7_6.x86_64 32/32 已安装: git.x86_64 0:1.8.3.1-20.el7 作为依赖被安装: perl.x86_64 4:5.16.3-294.el7_6 perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7 perl-Error.noarch 1:0.17020-2.el7 perl-Exporter.noarch 0:5.68-3.el7 perl-File-Path.noarch 0:2.09-2.el7 perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7 perl-Getopt-Long.noarch 0:2.40-3.el7 perl-Git.noarch 0:1.8.3.1-20.el7 perl-HTTP-Tiny.noarch 0:0.033-3.el7 perl-PathTools.x86_64 0:3.40-5.el7 perl-Pod-Escapes.noarch 1:1.04-294.el7_6 perl-Pod-Perldoc.noarch 0:3.20-4.el7 perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-4.el7 perl-Storable.x86_64 0:2.45-3.el7 perl-TermReadKey.x86_64 0:2.30-20.el7 perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7 perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-294.el7_6 perl-macros.x86_64 4:5.16.3-294.el7_6 perl-parent.noarch 1:0.225-244.el7 perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7 perl-threads-shared.x86_64 0:1.43-6.el7 rsync.x86_64 0:3.1.2-4.el7 完毕!
#切换到用户 git [root@192 ~]# su - git 上一次登录:四 3月 21 11:24:44 CST 2019pts/0 上
#创建一个仓库文件夹 加上.git只是代码规范 [git@192 ~]$ mkdir tomcat-java-demo.git [git@192 ~]$ ls tomcat-java-demo.git [git@192 ~]$ ls tomcat-java-demo.git [git@192 ~]$ cd tomcat-java-demo.git/ [git@192 tomcat-java-demo.git]$ ls
# 把文件夹初始化为一个git代码仓库 [git@192 tomcat-java-demo.git]$ git --bare init 初始化空的 Git 版本库于 /home/git/tomcat-java-demo.git/ [git@192 tomcat-java-demo.git]$ ls branches config description HEAD hooks info objects refs [git@192 tomcat-java-demo.git]$ pwd /home/git/tomcat-java-demo.git [END] 2019/3/21 11:35:11
3. 192.168.1.40机器去拉取 git 代码仓库里的代码
[BEGIN] 2019/3/21 11:30:51 [root@192 ~]# clear
# git客户端也是这样安装的(git客户端和仓库端,安装方法一样)
[root@192 ~]# yum install git -y Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.cn99.com * updates: mirrors.huaweicloud.com Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:1.8.3.1-20.el7 will be installed --> Processing Dependency: perl-Git = 1.8.3.1-20.el7 for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl >= 5.008 for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: rsync for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(warnings) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(vars) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(strict) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(lib) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(Git) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(Getopt::Long) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(File::stat) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(File::Temp) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(File::Spec) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(File::Path) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(File::Find) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(File::Copy) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(File::Basename) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(Exporter) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: perl(Error) for package: git-1.8.3.1-20.el7.x86_64 --> Processing Dependency: /usr/bin/perl for package: git-1.8.3.1-20.el7.x86_64 --> Running transaction check ---> Package perl.x86_64 4:5.16.3-294.el7_6 will be installed --> Processing Dependency: perl-libs = 4:5.16.3-294.el7_6 for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl-macros for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl-libs for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-294.el7_6.x86_64 --> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.16.3-294.el7_6.x86_64 ---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed ---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed ---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed ---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed ---> Package perl-Getopt-Long.noarch 0:2.40-3.el7 will be installed --> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-3.el7.noarch --> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-3.el7.noarch ---> Package perl-Git.noarch 0:1.8.3.1-20.el7 will be installed ---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed ---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed ---> Package rsync.x86_64 0:3.1.2-4.el7 will be installed --> Running transaction check ---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed ---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed ---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed --> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch --> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch ---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed --> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch --> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch ---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed ---> Package perl-Socket.x86_64 0:2.010-4.el7 will be installed ---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed ---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed ---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed ---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed ---> Package perl-constant.noarch 0:1.27-2.el7 will be installed ---> Package perl-libs.x86_64 4:5.16.3-294.el7_6 will be installed ---> Package perl-macros.x86_64 4:5.16.3-294.el7_6 will be installed ---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed ---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed --> Running transaction check ---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed ---> Package perl-Pod-Escapes.noarch 1:1.04-294.el7_6 will be installed ---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed --> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch --> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch ---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed --> Running transaction check ---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed ---> Package perl-parent.noarch 1:0.225-244.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =============================================================================================== Package Arch Version Repository Size =============================================================================================== Installing: git x86_64 1.8.3.1-20.el7 updates 4.4 M Installing for dependencies: perl x86_64 4:5.16.3-294.el7_6 updates 8.0 M perl-Carp noarch 1.26-244.el7 base 19 k perl-Encode x86_64 2.51-7.el7 base 1.5 M perl-Error noarch 1:0.17020-2.el7 base 32 k perl-Exporter noarch 5.68-3.el7 base 28 k perl-File-Path noarch 2.09-2.el7 base 26 k perl-File-Temp noarch 0.23.01-3.el7 base 56 k perl-Filter x86_64 1.49-3.el7 base 76 k perl-Getopt-Long noarch 2.40-3.el7 base 56 k perl-Git noarch 1.8.3.1-20.el7 updates 55 k perl-HTTP-Tiny noarch 0.033-3.el7 base 38 k perl-PathTools x86_64 3.40-5.el7 base 82 k perl-Pod-Escapes noarch 1:1.04-294.el7_6 updates 51 k perl-Pod-Perldoc noarch 3.20-4.el7 base 87 k perl-Pod-Simple noarch 1:3.28-4.el7 base 216 k perl-Pod-Usage noarch 1.63-3.el7 base 27 k perl-Scalar-List-Utils x86_64 1.27-248.el7 base 36 k perl-Socket x86_64 2.010-4.el7 base 49 k perl-Storable x86_64 2.45-3.el7 base 77 k perl-TermReadKey x86_64 2.30-20.el7 base 31 k perl-Text-ParseWords noarch 3.29-4.el7 base 14 k perl-Time-HiRes x86_64 4:1.9725-3.el7 base 45 k perl-Time-Local noarch 1.2300-2.el7 base 24 k perl-constant noarch 1.27-2.el7 base 19 k perl-libs x86_64 4:5.16.3-294.el7_6 updates 688 k perl-macros x86_64 4:5.16.3-294.el7_6 updates 44 k perl-parent noarch 1:0.225-244.el7 base 12 k perl-podlators noarch 2.5.1-3.el7 base 112 k perl-threads x86_64 1.87-4.el7 base 49 k perl-threads-shared x86_64 1.43-6.el7 base 39 k rsync x86_64 3.1.2-4.el7 base 403 k Transaction Summary =============================================================================================== Install 1 Package (+31 Dependent packages) Total download size: 16 M Installed size: 59 M Downloading packages: (1/32): perl-Error-0.17020-2.el7.noarch.rpm | 32 kB 00:00:00 (2/32): perl-Exporter-5.68-3.el7.noarch.rpm | 28 kB 00:00:00 (3/32): perl-File-Path-2.09-2.el7.noarch.rpm | 26 kB 00:00:00 (4/32): perl-File-Temp-0.23.01-3.el7.noarch.rpm | 56 kB 00:00:00 (5/32): perl-Filter-1.49-3.el7.x86_64.rpm | 76 kB 00:00:00 (6/32): perl-Getopt-Long-2.40-3.el7.noarch.rpm | 56 kB 00:00:00 (7/32): git-1.8.3.1-20.el7.x86_64.rpm | 4.4 MB 00:00:01 (8/32): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm | 38 kB 00:00:00 (9/32): perl-Git-1.8.3.1-20.el7.noarch.rpm | 55 kB 00:00:00 (10/32): perl-PathTools-3.40-5.el7.x86_64.rpm | 82 kB 00:00:00 (11/32): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm | 87 kB 00:00:00 (12/32): perl-Pod-Escapes-1.04-294.el7_6.noarch.rpm | 51 kB 00:00:00 (13/32): perl-Pod-Simple-3.28-4.el7.noarch.rpm | 216 kB 00:00:00 (14/32): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm | 36 kB 00:00:00 (15/32): perl-Socket-2.010-4.el7.x86_64.rpm | 49 kB 00:00:00 (16/32): perl-Storable-2.45-3.el7.x86_64.rpm | 77 kB 00:00:00 (17/32): perl-Carp-1.26-244.el7.noarch.rpm | 19 kB 00:00:01 (18/32): perl-TermReadKey-2.30-20.el7.x86_64.rpm | 31 kB 00:00:00 (19/32): perl-Time-HiRes-1.9725-3.el7.x86_64.rpm | 45 kB 00:00:00 (20/32): perl-Time-Local-1.2300-2.el7.noarch.rpm | 24 kB 00:00:00 (21/32): perl-constant-1.27-2.el7.noarch.rpm | 19 kB 00:00:00 (22/32): perl-5.16.3-294.el7_6.x86_64.rpm | 8.0 MB 00:00:01 (23/32): perl-libs-5.16.3-294.el7_6.x86_64.rpm | 688 kB 00:00:00 (24/32): perl-parent-0.225-244.el7.noarch.rpm | 12 kB 00:00:00 (25/32): perl-podlators-2.5.1-3.el7.noarch.rpm | 112 kB 00:00:00 (26/32): perl-macros-5.16.3-294.el7_6.x86_64.rpm | 44 kB 00:00:00 (27/32): perl-threads-1.87-4.el7.x86_64.rpm | 49 kB 00:00:00 (28/32): rsync-3.1.2-4.el7.x86_64.rpm | 403 kB 00:00:00 (29/32): perl-threads-shared-1.43-6.el7.x86_64.rpm | 39 kB 00:00:00 (30/32): perl-Pod-Usage-1.63-3.el7.noarch.rpm | 27 kB 00:00:00 (31/32): perl-Text-ParseWords-3.29-4.el7.noarch.rpm | 14 kB 00:00:00 (32/32): perl-Encode-2.51-7.el7.x86_64.rpm | 1.5 MB 00:00:08 ----------------------------------------------------------------------------------------------- Total 1.9 MB/s | 16 MB 00:00:08 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : 1:perl-parent-0.225-244.el7.noarch 1/32 Installing : perl-HTTP-Tiny-0.033-3.el7.noarch 2/32 Installing : perl-podlators-2.5.1-3.el7.noarch 3/32 Installing : perl-Pod-Perldoc-3.20-4.el7.noarch 4/32 Installing : 1:perl-Pod-Escapes-1.04-294.el7_6.noarch 5/32 Installing : perl-Encode-2.51-7.el7.x86_64 6/32 Installing : perl-Text-ParseWords-3.29-4.el7.noarch 7/32 Installing : perl-Pod-Usage-1.63-3.el7.noarch 8/32 Installing : 4:perl-libs-5.16.3-294.el7_6.x86_64 9/32 Installing : 4:perl-macros-5.16.3-294.el7_6.x86_64 10/32 Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 11/32 Installing : perl-Exporter-5.68-3.el7.noarch 12/32 Installing : perl-constant-1.27-2.el7.noarch 13/32 Installing : perl-Time-Local-1.2300-2.el7.noarch 14/32 Installing : perl-Socket-2.010-4.el7.x86_64 15/32 Installing : perl-Carp-1.26-244.el7.noarch 16/32 Installing : perl-Storable-2.45-3.el7.x86_64 17/32 Installing : perl-PathTools-3.40-5.el7.x86_64 18/32 Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64 19/32 Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch 20/32 Installing : perl-File-Temp-0.23.01-3.el7.noarch 21/32 Installing : perl-File-Path-2.09-2.el7.noarch 22/32 Installing : perl-threads-shared-1.43-6.el7.x86_64 23/32 Installing : perl-threads-1.87-4.el7.x86_64 24/32 Installing : perl-Filter-1.49-3.el7.x86_64 25/32 Installing : perl-Getopt-Long-2.40-3.el7.noarch 26/32 Installing : 4:perl-5.16.3-294.el7_6.x86_64 27/32 Installing : 1:perl-Error-0.17020-2.el7.noarch 28/32 Installing : perl-TermReadKey-2.30-20.el7.x86_64 29/32 Installing : rsync-3.1.2-4.el7.x86_64 30/32 Installing : perl-Git-1.8.3.1-20.el7.noarch 31/32 Installing : git-1.8.3.1-20.el7.x86_64 32/32 Verifying : perl-HTTP-Tiny-0.033-3.el7.noarch 1/32 Verifying : perl-threads-shared-1.43-6.el7.x86_64 2/32 Verifying : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 3/32 Verifying : 1:perl-Pod-Escapes-1.04-294.el7_6.noarch 4/32 Verifying : perl-Exporter-5.68-3.el7.noarch 5/32 Verifying : perl-constant-1.27-2.el7.noarch 6/32 Verifying : perl-PathTools-3.40-5.el7.x86_64 7/32 Verifying : 1:perl-parent-0.225-244.el7.noarch 8/32 Verifying : perl-TermReadKey-2.30-20.el7.x86_64 9/32 Verifying : 4:perl-libs-5.16.3-294.el7_6.x86_64 10/32 Verifying : perl-File-Temp-0.23.01-3.el7.noarch 11/32 Verifying : 1:perl-Pod-Simple-3.28-4.el7.noarch 12/32 Verifying : perl-Time-Local-1.2300-2.el7.noarch 13/32 Verifying : 4:perl-macros-5.16.3-294.el7_6.x86_64 14/32 Verifying : perl-Socket-2.010-4.el7.x86_64 15/32 Verifying : perl-Carp-1.26-244.el7.noarch 16/32 Verifying : 1:perl-Error-0.17020-2.el7.noarch 17/32 Verifying : git-1.8.3.1-20.el7.x86_64 18/32 Verifying : perl-Storable-2.45-3.el7.x86_64 19/32 Verifying : perl-Scalar-List-Utils-1.27-248.el7.x86_64 20/32 Verifying : perl-Git-1.8.3.1-20.el7.noarch 21/32 Verifying : rsync-3.1.2-4.el7.x86_64 22/32 Verifying : perl-Pod-Usage-1.63-3.el7.noarch 23/32 Verifying : perl-Encode-2.51-7.el7.x86_64 24/32 Verifying : perl-Pod-Perldoc-3.20-4.el7.noarch 25/32 Verifying : perl-podlators-2.5.1-3.el7.noarch 26/32 Verifying : perl-File-Path-2.09-2.el7.noarch 27/32 Verifying : perl-threads-1.87-4.el7.x86_64 28/32 Verifying : perl-Filter-1.49-3.el7.x86_64 29/32 Verifying : perl-Getopt-Long-2.40-3.el7.noarch 30/32 Verifying : perl-Text-ParseWords-3.29-4.el7.noarch 31/32 Verifying : 4:perl-5.16.3-294.el7_6.x86_64 32/32 Installed: git.x86_64 0:1.8.3.1-20.el7 Dependency Installed: perl.x86_64 4:5.16.3-294.el7_6 perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7 perl-Error.noarch 1:0.17020-2.el7 perl-Exporter.noarch 0:5.68-3.el7 perl-File-Path.noarch 0:2.09-2.el7 perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7 perl-Getopt-Long.noarch 0:2.40-3.el7 perl-Git.noarch 0:1.8.3.1-20.el7 perl-HTTP-Tiny.noarch 0:0.033-3.el7 perl-PathTools.x86_64 0:3.40-5.el7 perl-Pod-Escapes.noarch 1:1.04-294.el7_6 perl-Pod-Perldoc.noarch 0:3.20-4.el7 perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-4.el7 perl-Storable.x86_64 0:2.45-3.el7 perl-TermReadKey.x86_64 0:2.30-20.el7 perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7 perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-294.el7_6 perl-macros.x86_64 4:5.16.3-294.el7_6 perl-parent.noarch 1:0.225-244.el7 perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7 perl-threads-shared.x86_64 0:1.43-6.el7 rsync.x86_64 0:3.1.2-4.el7 Complete! [root@192 ~]# git clone git@192.168.1.30:/home/git/tomcat-java-demo.git Cloning into 'tomcat-java-demo'... The authenticity of host '192.168.1.30 (192.168.1.30)' can't be established. ECDSA key fingerprint is SHA256:J2OyGebNBy8rCxm7BLidiHnGY0ikFPrTkCrqMdvyJ78. ECDSA key fingerprint is MD5:f1:9e:b6:a5:d8:85:8c:89:06:f8:8d:87:8c:5a:97:a1. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.1.30' (ECDSA) to the list of known hosts. git@192.168.1.30's password: Permission denied, please try again. git@192.168.1.30's password: warning: You appear to have cloned an empty repository. [root@192 ~]# ls anaconda-ks.cfg tomcat-java-demo [root@192 ~]# cd tomcat-java-demo/ [root@192 tomcat-java-demo]# ls [END] 2019/3/21 11:35:15
4. 先在192.168.1.40机器上,编写代码(实际项目的代码,这里为了演示方便从github上拉取一个开源的代码),再将这些代码提交到192.168.1.30上的git代码版本仓库里,
[root@192 ~]# mv tomcat-java-demo tomcat-java-demo.bak
#从https://github.com/lizhenliang/tomcat-java-demo拉取代码 [root@192 ~]# git clone https://github.com/lizhenliang/tomcat-java-demo Cloning into 'tomcat-java-demo'... remote: Enumerating objects: 229, done. remote: Counting objects: 100% (229/229), done. remote: Compressing objects: 100% (205/205), done. remote: Total 229 (delta 25), reused 180 (delta 5), pack-reused 0 Receiving objects: 100% (229/229), 4.52 MiB | 46.00 KiB/s, done. Resolving deltas: 100% (25/25), done. [root@192 ~]# ls anaconda-ks.cfg tomcat-java-demo tomcat-java-demo.bak [root@192 ~]# cd tomcat-java-demo [root@192 tomcat-java-demo]# ls doc Dockerfile LICENSE pom.xml README.md src
因为代码是从github上拉取的,需要修改隐藏的 .git/config文件, 修改url 为私有git仓库地址
#提交代码到本地暂存区
[root@192 tomcat-java-demo]# git add .
#提交代码到本地代码仓库 [root@192 tomcat-java-demo]# git commit -m 'all' # On branch master nothing to commit, working directory clean
#推送代码到中央代码仓库,至于origin 和master是什么,请看 .git/config文件 [root@192 tomcat-java-demo]# git push origin master
5. 到192.168.1.30机器上 查看代码是否提交到了仓库
很遗憾, 在代码仓库下,是没法直接查看的。
我们可以通过其他的方式,在安装git工具的环境下,clone项目下来
另一个方法:在windows上安装 TortoiseGIT工具,进行如下配置后, clone项目到本地
另外, TortoiseGIT工具在windows上非常好用。 对测试人员来说, 看代码提交日志,非常方便
6. 在192.168.1.40机器上部署jenkins,安装jdk,maven
将准备好的jdk-8u45-linux-x64.tar.gz
apache-maven-3.5.0-bin.tar.gz
jenkins.war (下载地址:http://mirrors.jenkins.io/war-stable/latest/jenkins.war)
apache-tomcat-8.0.46.tar.gz文件放到 192.168.1.40 机器上, 不知道如何放文件 可参考 Docker: 构建Nginx,PHP,Tomcat基础镜像
解压maven,jdk 配置jdk环境变量
[root@192 ~]# ls anaconda-ks.cfg jdk-8u45-linux-x64.tar.gz tomcat-java-demo apache-maven-3.5.0-bin.tar.gz jenkins.war tomcat-java-demo.bak
apache-tomcat-8.0.46.tar.gz [root@192 ~]# tar xzvf jdk-8u45-linux-x64.tar.gz ... [root@192 ~]# tar zxvf apache-maven-3.5.0-bin.tar.gz [root@192 ~]# mv apache-maven-3.5.0 /usr/local/maven [root@192 ~]# mv jdk1.8.0_45/ /usr/local/jdk [root@192 ~]# vi /etc/profile
在文件最后追加
JAVA_HOME=/usr/local/jdk
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME PATH
[root@192 ~]# source /etc/profile [root@192 ~]# java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
部署jenkins
[root@192 ~]# tar zxvf apache-tomcat-8.0.46.tar.gz [root@192 ~]# mv apache-tomcat-8.0.46 /usr/local/jenkins_tomcat [root@192 ~]# cd /usr/local/jenkins_tomcat [root@192 jenkins_tomcat]# ls bin conf lib LICENSE logs NOTICE RELEASE-NOTES RUNNING.txt temp webapps work
#删除 webapps下的所有内容(默认都是一些测试页面,这里用不到,所以删除) [root@192 jenkins_tomcat]# cd webapps/ [root@192 webapps]# ls docs examples host-manager manager ROOT [root@192 webapps]# rm -rf *
#移动jenkins到webapps下,并重命名为 ROOT.war,因为浏览器默认访问地址输入后,默认访问路径是 ROOT下的index.html. 如果不重命名, 浏览器访问时,需要加jenkins.war中的jenkins这个关键字 [root@192 webapps]# mv /root/jenkins.war ROOT.war [root@192 webapps]# cd ../bin [root@192 bin]# ./startup.sh Using CATALINA_BASE: /usr/local/jenkins_tomcat Using CATALINA_HOME: /usr/local/jenkins_tomcat Using CATALINA_TMPDIR: /usr/local/jenkins_tomcat/temp Using JRE_HOME: /usr/local/jdk Using CLASSPATH: /usr/local/jenkins_tomcat/bin/bootstrap.jar:/usr/local/jenkins_tomcat/bin/tomcat-juli.jar Tomcat started.
# catalina.out里面有jenkins登陆页面的初始密码 [root@192 bin]# tail ../logs/catalina.out
到此,jenkins部署好了,可以通过浏览器 http://192.168.1.40:8080 进行访问了
[Skip plugin installations]->其他步骤 设置jenkins 管理界面登陆用户和密码,直到下一步完成。
jenkins插件安装
登陆后,系统管理,插件管理,advanced标签页,拉到最下面 Update site 里,默认的地址, https 修改成http。(在上面jenkins提示offline,所以连接官方安装插件会有问题,这里https修改成http后,大多数情况,能解决插件安装连接不上的问题), submit 后,点check now
安装插件: Available标签里选择pipeline ,-> intall without restart,
安装完毕后,可以在intalled标签里,看到已安装的插件
这些都是pipeline勾选后,默认安装的关联插件。
Jenkins里创建job
New job->Enter an item name:tomcat-java-demo,类型,选流水线->OK,Configure
pipleline完整脚本
node { // 拉取代码 git从git仓库中拉取代码,采用的是免交互方式 checkout如何产生?参考 Docker:pipeline编写基本技巧- jenkins配置通过密钥拉取git源码管理仓库的代码 stage('Git Checkout') { checkout([$class: 'GitSCM', branches: [[name: '${branch}']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'a3b0ae29-ebaa-46b8-a75b-27c86c31fbba', url: '[email protected]:/home/git/tomcat-java-demo.git']]]) } // 代码编译 stage('Maven Build') { sh ''' export JAVA_HOME=/usr/local/jdk /usr/local/maven/bin/mvn clean package -Dmaven.test.skip=true ''' } // 项目打包到镜像并推送到镜像仓库 stage('Build and Push Image') { sh ''' REPOSITORY=192.168.1.30/library/tomcat-java-demo:${branch} cat > Dockerfile << EOF FROM 192.168.1.30/library/tomcat:v1 MAINTAINER meimei RUN rm -rf /usr/local/tomcat/webapps/* ADD target/*.war /usr/local/tomcat/webapps/ROOT.war EOF docker build -t $REPOSITORY . docker login 192.168.1.30 -u admin -p Harbor12345 docker push $REPOSITORY ''' } // 部署到Docker主机 stage('Deploy to Docker') { sh ''' REPOSITORY=192.168.1.30/library/tomcat-java-demo:${branch} docker rm -f tomcat-java-demo |true docker pull $REPOSITORY docker container run -d --name tomcat-java-demo -p 88:8080 $REPOSITORY ''' } }
上面脚本中有个变量 ${branch},branch这个变量是用了jenkins的参数化构建功能
选中job->Configure
配置好后,save。
jenkins机器需要往Harbor镜像仓库推送镜像,需要将Harbor服务器的地址设置成为jenkins所在机器的docker服务可信任Harbor地址
//192.168.1.40 机器上
[root@192 ~]# cat /etc/docker/daemon.json {"registry-mirrors": ["http://f1361db2.m.daocloud.io"]} [root@192 ~]# vi /etc/docker/daemon.json {"registry-mirrors": ["http://f1361db2.m.daocloud.io"], "insecure-registries":["192.168.1.30"]}
//保存后退出
[root@192 ~]# systemctl restart docker
(对这部分理解有困难的,可参考 Docker: 企业级镜像仓库Harbor的使用 )
执行构建
到此构建成功。
接下来我们验证一下 Harbor镜像仓库里是否有新的推送上来的tomcat-java-demo镜像,和jenkins服务器上是否有运行着的tomcat服务,并且通过网页访问是否成功
到此,测试成功。
总结一下:jenkins完成了如下流程
jenkins拉取git仓库的代码->maven编译打包产品成war包->把war包构建进docker镜像->将镜像推送到Harbor镜像仓库->从Harbor镜像仓库拉取镜像,并运行镜像
作者: 梅梅~
出处: https://www.cnblogs.com/keeptesting
关于作者:专注软件测试,测试运维相关工作,请多多赐教!
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 原文链接 欢迎沟通交流加微信联系。 微信:yangguangkg20140901 暗号:博客园.