centos7+gitlab-runner安装及注册gitlab服务器中流程步骤

2023-06-01 00:00:00 gitlab centos7

为了接上一篇这篇gitlab-runner安装注册就归类至docker,gitlab服务我已在另一台服务器上安装好用的docker:

https://www.zongscan.com/demo333/95354.html

现在在这台服务器上安装gitlab-runner服务及注册gitlab服务器


进入步骤:

安装gitlab-runner: 

添加gitlab官方库

[[email protected] ~]# curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
...省略...

执行安装命令

[[email protected] ~]# yum install gitlab-runner
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.ustc.edu.cn
base                                                                                | 3.6 kB  00:00:00     
docker-ce-stable                                                                    | 3.5 kB  00:00:00     
extras                                                                              | 2.9 kB  00:00:00     
runner_gitlab-runner/x86_64/signature                                               |  862 B  00:00:00     
runner_gitlab-runner/x86_64/signature                                               | 1.0 kB  00:00:00 !!! 
runner_gitlab-runner-source/signature                                               |  862 B  00:00:00     
runner_gitlab-runner-source/signature                                               |  951 B  00:00:00 !!! 
updates                                                                             | 2.9 kB  00:00:00     
(1/6): base/7/x86_64/group_gz                                                       | 153 kB  00:00:00     
(2/6): extras/7/x86_64/primary_db                                                   | 243 kB  00:00:00     
(3/6): docker-ce-stable/7/x86_64/updateinfo                                         |   55 B  00:00:00     
(4/6): docker-ce-stable/7/x86_64/primary_db                                         |  70 kB  00:00:00     
(5/6): base/7/x86_64/primary_db                                                     | 6.1 MB  00:00:01     
(6/6): updates/7/x86_64/primary_db                                                  |  13 MB  00:00:03     
(1/2): runner_gitlab-runner/x86_64/primary                                          |  10 kB  00:00:09     
(2/2): runner_gitlab-runner-source/primary                                          |  175 B  00:00:10     
runner_gitlab-runner                                                                               109/109
Resolving Dependencies
--> Running transaction check
---> Package gitlab-runner.x86_64 0:14.7.0-1 will be installed
--> Processing Dependency: git for package: gitlab-runner-14.7.0-1.x86_64
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-23.el7_8 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-23.el7_8 for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl >= 5.008 for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(warnings) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(vars) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(strict) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(lib) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Getopt::Long) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(File::stat) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(File::Temp) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(File::Spec) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(File::Path) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(File::Find) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(File::Copy) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(File::Basename) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Exporter) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: /usr/bin/perl for package: git-1.8.3.1-23.el7_8.x86_64
--> Running transaction check
---> Package perl.x86_64 4:5.16.3-299.el7_9 will be installed
--> Processing Dependency: perl-libs = 4:5.16.3-299.el7_9 for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl-macros for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl-libs for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-299.el7_9.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.16.3-299.el7_9.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-23.el7_8 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-10.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-5.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-299.el7_9 will be installed
---> Package perl-macros.x86_64 4:5.16.3-299.el7_9 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-299.el7_9 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:
 gitlab-runner                 x86_64        14.7.0-1                    runner_gitlab-runner        414 M
Installing for dependencies:
 git                           x86_64        1.8.3.1-23.el7_8            base                        4.4 M
 perl                          x86_64        4:5.16.3-299.el7_9          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-23.el7_8            base                         56 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-299.el7_9            updates                      52 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-5.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-299.el7_9          updates                     690 k
 perl-macros                   x86_64        4:5.16.3-299.el7_9          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-10.el7                base                        404 k
Transaction Summary
===========================================================================================================
Install  1 Package (+32 Dependent packages)
Total download size: 430 M
Installed size: 507 M
Is this ok [y/d/N]: y
Downloading packages:
(1/33): perl-Carp-1.26-244.el7.noarch.rpm                                           |  19 kB  00:00:00     
(2/33): perl-Encode-2.51-7.el7.x86_64.rpm                                           | 1.5 MB  00:00:00     
(3/33): perl-5.16.3-299.el7_9.x86_64.rpm                                            | 8.0 MB  00:00:01     
(4/33): perl-Error-0.17020-2.el7.noarch.rpm                                         |  32 kB  00:00:01     
(5/33): perl-Exporter-5.68-3.el7.noarch.rpm                                         |  28 kB  00:00:00     
(6/33): git-1.8.3.1-23.el7_8.x86_64.rpm                                             | 4.4 MB  00:00:03     
(7/33): perl-File-Path-2.09-2.el7.noarch.rpm                                        |  26 kB  00:00:00     
(8/33): perl-File-Temp-0.23.01-3.el7.noarch.rpm                                     |  56 kB  00:00:00     
(9/33): perl-Filter-1.49-3.el7.x86_64.rpm                                           |  76 kB  00:00:00     
(10/33): perl-Getopt-Long-2.40-3.el7.noarch.rpm                                     |  56 kB  00:00:00     
(11/33): perl-Git-1.8.3.1-23.el7_8.noarch.rpm                                       |  56 kB  00:00:00     
(12/33): perl-PathTools-3.40-5.el7.x86_64.rpm                                       |  82 kB  00:00:00     
(13/33): perl-Pod-Escapes-1.04-299.el7_9.noarch.rpm                                 |  52 kB  00:00:00     
(14/33): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm                                      |  38 kB  00:00:00     
(15/33): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm                                     |  87 kB  00:00:00     
(16/33): perl-Pod-Simple-3.28-4.el7.noarch.rpm                                      | 216 kB  00:00:00     
(17/33): perl-Pod-Usage-1.63-3.el7.noarch.rpm                                       |  27 kB  00:00:00     
(18/33): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm                             |  36 kB  00:00:00     
(19/33): perl-Storable-2.45-3.el7.x86_64.rpm                                        |  77 kB  00:00:00     
(20/33): perl-TermReadKey-2.30-20.el7.x86_64.rpm                                    |  31 kB  00:00:00     
(21/33): perl-Socket-2.010-5.el7.x86_64.rpm                                         |  49 kB  00:00:00     
(22/33): perl-Text-ParseWords-3.29-4.el7.noarch.rpm                                 |  14 kB  00:00:00     
(23/33): perl-Time-Local-1.2300-2.el7.noarch.rpm                                    |  24 kB  00:00:00     
(24/33): perl-Time-HiRes-1.9725-3.el7.x86_64.rpm                                    |  45 kB  00:00:00     
(25/33): perl-constant-1.27-2.el7.noarch.rpm                                        |  19 kB  00:00:00     
(26/33): perl-parent-0.225-244.el7.noarch.rpm                                       |  12 kB  00:00:00     
(27/33): perl-podlators-2.5.1-3.el7.noarch.rpm                                      | 112 kB  00:00:00     
(28/33): perl-threads-1.87-4.el7.x86_64.rpm                                         |  49 kB  00:00:00     
(29/33): perl-libs-5.16.3-299.el7_9.x86_64.rpm                                      | 690 kB  00:00:00     
(30/33): perl-threads-shared-1.43-6.el7.x86_64.rpm                                  |  39 kB  00:00:00     
(31/33): rsync-3.1.2-10.el7.x86_64.rpm                                              | 404 kB  00:00:00     
(32/33): perl-macros-5.16.3-299.el7_9.x86_64.rpm                                    |  44 kB  00:00:00     
warning: /var/cache/yum/x86_64/7/runner_gitlab-runner/packages/gitlab-runner-14.7.0-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 35dfa027: NOKEY
Public key for gitlab-runner-14.7.0-1.x86_64.rpm is not installed
(33/33): gitlab-runner-14.7.0-1.x86_64.rpm                                          | 414 MB  00:01:37     
-----------------------------------------------------------------------------------------------------------
Total                                                                      4.4 MB/s | 430 MB  00:01:37     
Retrieving key from https://packages.gitlab.com/runner/gitlab-runner/gpgkey
Importing GPG key 0x51312F3F:
 Userid     : "GitLab B.V. (package repository signing key) <[email protected]>"
 Fingerprint: f640 3f65 44a3 8863 daa0 b6e0 3f01 618a 5131 2f3f
 From       : https://packages.gitlab.com/runner/gitlab-runner/gpgkey
Is this ok [y/N]: y
Retrieving key from https://packages.gitlab.com/runner/gitlab-runner/gpgkey/runner-gitlab-runner-4C80FB51394521E9.pub.gpg
Importing GPG key 0x35DFA027:
 Userid     : "GitLab, Inc. <[email protected]>"
 Fingerprint: 09e5 7083 f34c ca94 d541 bc58 a674 bf81 35df a027
 From       : https://packages.gitlab.com/runner/gitlab-runner/gpgkey/runner-gitlab-runner-4C80FB51394521E9.pub.gpg
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-parent-0.225-244.el7.noarch                                                     1/33 
  Installing : perl-HTTP-Tiny-0.033-3.el7.noarch                                                      2/33 
  Installing : perl-podlators-2.5.1-3.el7.noarch                                                      3/33 
  Installing : perl-Pod-Perldoc-3.20-4.el7.noarch                                                     4/33 
  Installing : 1:perl-Pod-Escapes-1.04-299.el7_9.noarch                                               5/33 
  Installing : perl-Encode-2.51-7.el7.x86_64                                                          6/33 
  Installing : perl-Text-ParseWords-3.29-4.el7.noarch                                                 7/33 
  Installing : perl-Pod-Usage-1.63-3.el7.noarch                                                       8/33 
  Installing : 4:perl-macros-5.16.3-299.el7_9.x86_64                                                  9/33 
  Installing : perl-Storable-2.45-3.el7.x86_64                                                       10/33 
  Installing : perl-Exporter-5.68-3.el7.noarch                                                       11/33 
  Installing : perl-constant-1.27-2.el7.noarch                                                       12/33 
  Installing : perl-Socket-2.010-5.el7.x86_64                                                        13/33 
  Installing : perl-Time-Local-1.2300-2.el7.noarch                                                   14/33 
  Installing : perl-Carp-1.26-244.el7.noarch                                                         15/33 
  Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                                                 16/33 
  Installing : perl-PathTools-3.40-5.el7.x86_64                                                      17/33 
  Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64                                            18/33 
  Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch                                                   19/33 
  Installing : perl-File-Temp-0.23.01-3.el7.noarch                                                   20/33 
  Installing : perl-File-Path-2.09-2.el7.noarch                                                      21/33 
  Installing : perl-threads-shared-1.43-6.el7.x86_64                                                 22/33 
  Installing : perl-threads-1.87-4.el7.x86_64                                                        23/33 
  Installing : perl-Filter-1.49-3.el7.x86_64                                                         24/33 
  Installing : 4:perl-libs-5.16.3-299.el7_9.x86_64                                                   25/33 
  Installing : perl-Getopt-Long-2.40-3.el7.noarch                                                    26/33 
  Installing : 4:perl-5.16.3-299.el7_9.x86_64                                                        27/33 
  Installing : 1:perl-Error-0.17020-2.el7.noarch                                                     28/33 
  Installing : perl-TermReadKey-2.30-20.el7.x86_64                                                   29/33 
  Installing : rsync-3.1.2-10.el7.x86_64                                                             30/33 
  Installing : perl-Git-1.8.3.1-23.el7_8.noarch                                                      31/33 
  Installing : git-1.8.3.1-23.el7_8.x86_64                                                           32/33 
  Installing : gitlab-runner-14.7.0-1.x86_64                                                         33/33 
GitLab Runner: creating gitlab-runner...
Home directory skeleton not used
Runtime platform                                    arch=amd64 os=linux pid=30749 revision=98daeee0 version=14.7.0
gitlab-runner: the service is not installed
Runtime platform                                    arch=amd64 os=linux pid=30757 revision=98daeee0 version=14.7.0
gitlab-ci-multi-runner: the service is not installed
Runtime platform                                    arch=amd64 os=linux pid=30781 revision=98daeee0 version=14.7.0
Runtime platform                                    arch=amd64 os=linux pid=30817 revision=98daeee0 version=14.7.0
/usr/share/gitlab-runner/clear-docker-cache: line 16: /bin/docker: Permission denied
  Verifying  : perl-HTTP-Tiny-0.033-3.el7.noarch                                                      1/33 
  Verifying  : perl-threads-shared-1.43-6.el7.x86_64                                                  2/33 
  Verifying  : perl-Storable-2.45-3.el7.x86_64                                                        3/33 
  Verifying  : perl-Exporter-5.68-3.el7.noarch                                                        4/33 
  Verifying  : perl-constant-1.27-2.el7.noarch                                                        5/33 
  Verifying  : perl-PathTools-3.40-5.el7.x86_64                                                       6/33 
  Verifying  : perl-Socket-2.010-5.el7.x86_64                                                         7/33 
  Verifying  : git-1.8.3.1-23.el7_8.x86_64                                                            8/33 
  Verifying  : 1:perl-parent-0.225-244.el7.noarch                                                     9/33 
  Verifying  : 4:perl-macros-5.16.3-299.el7_9.x86_64                                                 10/33 
  Verifying  : gitlab-runner-14.7.0-1.x86_64                                                         11/33 
  Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                                                   12/33 
  Verifying  : perl-File-Temp-0.23.01-3.el7.noarch                                                   13/33 
  Verifying  : 1:perl-Pod-Simple-3.28-4.el7.noarch                                                   14/33 
  Verifying  : perl-Time-Local-1.2300-2.el7.noarch                                                   15/33 
  Verifying  : 1:perl-Pod-Escapes-1.04-299.el7_9.noarch                                              16/33 
  Verifying  : perl-Git-1.8.3.1-23.el7_8.noarch                                                      17/33 
  Verifying  : perl-Carp-1.26-244.el7.noarch                                                         18/33 
  Verifying  : 1:perl-Error-0.17020-2.el7.noarch                                                     19/33 
  Verifying  : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                                                 20/33 
  Verifying  : perl-Scalar-List-Utils-1.27-248.el7.x86_64                                            21/33 
  Verifying  : perl-Pod-Usage-1.63-3.el7.noarch                                                      22/33 
  Verifying  : perl-Encode-2.51-7.el7.x86_64                                                         23/33 
  Verifying  : perl-Pod-Perldoc-3.20-4.el7.noarch                                                    24/33 
  Verifying  : perl-podlators-2.5.1-3.el7.noarch                                                     25/33 
  Verifying  : 4:perl-5.16.3-299.el7_9.x86_64                                                        26/33 
  Verifying  : perl-File-Path-2.09-2.el7.noarch                                                      27/33 
  Verifying  : perl-threads-1.87-4.el7.x86_64                                                        28/33 
  Verifying  : rsync-3.1.2-10.el7.x86_64                                                             29/33 
  Verifying  : perl-Filter-1.49-3.el7.x86_64                                                         30/33 
  Verifying  : perl-Getopt-Long-2.40-3.el7.noarch                                                    31/33 
  Verifying  : perl-Text-ParseWords-3.29-4.el7.noarch                                                32/33 
  Verifying  : 4:perl-libs-5.16.3-299.el7_9.x86_64                                                   33/33 
Installed:
  gitlab-runner.x86_64 0:14.7.0-1                                                                          
Dependency Installed:
  git.x86_64 0:1.8.3.1-23.el7_8                     perl.x86_64 4:5.16.3-299.el7_9                        
  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-23.el7_8                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-299.el7_9              
  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-5.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-299.el7_9                   
  perl-macros.x86_64 4:5.16.3-299.el7_9             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-10.el7                           
Complete!

ps:

如果出现以下错误:

Error downloading packages:
  gitlab-runner-14.7.0-1.x86_64: [Errno 256] No more mirrors to try.

解决方式:(清除缓存,然后在重新执行yum安装命令)

[[email protected] ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base docker-ce-stable extras runner_gitlab-runner runner_gitlab-runner-source updates
Cleaning up list of fastest mirrors

注册gitlab-runner:

[[email protected] ~]# gitlab-runner register --clone-url http://172.18.1.150/
Runtime platform                                    arch=amd64 os=linux pid=30863 revision=98daeee0 version=14.7.0
Running in system-mode.                            
                                                   
Enter the GitLab instance URL (for example, https://gitlab.com/):
http://172.18.1.150/
Enter the registration token:
Ht6xT5svRukxTqq5N9yx
Enter a description for the runner:
[work1]: 151^[[D^[[D^H^[[A^[[B
Enter tags for the runner (comma-separated):
builder
Registering runner... succeeded                     runner=Ht6xT5sv
Enter an executor: parallels, kubernetes, docker, docker-ssh, ssh, virtualbox, docker+machine, docker-ssh+machine, custom, shell:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! 

执行注册命令后会让你输入一下参数:

1.服务器url(我这里直接是指向gitlab服务器ip的web链接)

2.token (在gitlab服务器web中的左上角点击Menu->Admin->Runners中获取,如下图:)

gitlab-token.png

3.runner描述 (自己输就可以了)

4.标签tags  (自己输)

5.选择执行器 (选shell)

6.确定就完事了


ps:

不好意思上面手抖了一下,输入了个151^[[D^[[D^H^[[A^[[B这种东西出来,

不过问题不大,后面在改


去gitlab服务器那边runner中刷新看看效果:

gitlab-runner注册.png


相关文章