[转]gitlab cicd (二)系列之安装git-runner rpm安装方式
本文转自:https://blog.csdn.net/qq_21816375/article/details/84308748
本编是继gitlab cicd (一)系列之安装gitlb之后,基于安装gitlab-runner进行CI的部署教程(executor:docker)
系统
[root@gitlab-runner-64 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
安装docker
请参考安装docker 17.03.2.ce教程
安装gitlab rpm包
[root@gitlab-runner-64 ~]# curl -s https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
Detected operating system as centos/7.
Checking for curl...
Detected curl...
Downloading repository file: https://packages.gitlab.com/install/repositories/runner/gitlab-runner/config_file.repo?os=centos&dist=7&source=script
done.
Installing pygpgme to verify GPG signatures...
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.nwsuaf.edu.cn
* extras: mirrors.nwsuaf.edu.cn
* updates: mirrors.nwsuaf.edu.cn
runner_gitlab-runner-source/signature | 836 B 00:00:00
Retrieving key from https://packages.gitlab.com/runner/gitlab-runner/gpgkey
Importing GPG key 0xE15E78F4:
Userid : "GitLab B.V. (package repository signing key) <packages@gitlab.com>"
Fingerprint: 1a4c 919d b987 d435 9396 38b9 1421 9a96 e15e 78f4
From : https://packages.gitlab.com/runner/gitlab-runner/gpgkey
runner_gitlab-runner-source/signature | 951 B 00:00:00 !!!
runner_gitlab-runner-source/primary | 175 B 00:00:02
Package pygpgme-0.3-9.el7.x86_64 already installed and latest version
Nothing to do
Installing yum-utils...
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.nwsuaf.edu.cn
* extras: mirrors.nwsuaf.edu.cn
* updates: mirrors.nwsuaf.edu.cn
Package yum-utils-1.1.31-46.el7_5.noarch already installed and latest version
Nothing to do
Generating yum cache for runner_gitlab-runner...
Importing GPG key 0xE15E78F4:
Userid : "GitLab B.V. (package repository signing key) <packages@gitlab.com>"
Fingerprint: 1a4c 919d b987 d435 9396 38b9 1421 9a96 e15e 78f4
From : https://packages.gitlab.com/runner/gitlab-runner/gpgkey
The repository is setup! You can now install packages.
安装gitlab-runner
root@gitlab-runner-64 ~]# yum install gitlab-runner -y
1
启动gitlab-runner
[root@gitlab-runner-64 ~]# systemctl start gitlab-runner
[root@gitlab-runner-64 ~]# systemctl status gitlab-runner
● gitlab-runner.service - GitLab Runner
Loaded: loaded (/etc/systemd/system/gitlab-runner.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2018-11-20 15:33:55 CST; 1min 15s ago
Main PID: 27906 (gitlab-runner)
Memory: 4.9M
CGroup: /system.slice/gitlab-runner.service
└─27906 /usr/lib/gitlab-runner/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitla...
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]: Running in system-mode.
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]: Running in system-mode.
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]:
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]:
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]: Configuration loaded builds=0
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]: Configuration loaded builds=0
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]: Listen address not defined, metrics server disabled builds=0
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]: Listen address not defined, metrics server disabled builds=0
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]: Listen address not defined, session server disabled builds=0
Nov 20 15:33:55 gitlab-runner-64 gitlab-runner[27906]: Listen address not defined, session server disabled builds=0
注册gitlab
[root@gitlab-runner-64 ~]# gitlab-runner register
Runtime platform arch=amd64 os=linux pid=28891 revision=cf91d5e1 version=11.4.2
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://10.39.47.63
Please enter the gitlab-ci token for this runner:
xiwkMztdhy5ipdgpsjHC
Please enter the gitlab-ci description for this runner:
[gitlab-runner-64]: gitlab-runner-test
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag
Registering runner... succeeded runner=xiwkMztd
Please enter the executor: docker+machine, kubernetes, docker, parallels, shell, ssh, virtualbox, docker-ssh+machine, docker-ssh:
docker
Please enter the default Docker image (e.g. ruby:2.1):
golang:latest
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
#注册完成之后,gitlab-runner的配置文件会改变
[root@gitlab-runner-64 ~]# cat /etc/gitlab-runner/config.toml
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "gitlab-runner-test"
url = "http://10.39.47.63"
token = "477e1b6bba858703fd609e7ff991e4"
executor = "docker"
[runners.docker]
tls_verify = false
image = "golang:latest"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
从页面可以查看到
新建一个项目,项目根目录的.gitlab-ci.yml文件内容如下
job:
tags:
- test-tag ##注意这个是选择指定的runner
services:
- php:7
- node:latest
- golang:1.10
image: alpine:3.7
script:
- echo '========== hello gitlab-runner'
1
2
3
4
5
6
7
8
9
10
11
把该项目加入刚刚加的gitlab-runner里
查看执行结果
end
参考
Configuration of your jobs with .gitlab-ci.yml
runner-register
安装
生成token
---------------------
作者:qinzhao168
来源:CSDN
原文:https://blog.csdn.net/qq_21816375/article/details/84308748
版权声明:本文为博主原创文章,转载请附上博文链接!
[转]gitlab cicd (二)系列之安装git-runner rpm安装方式的更多相关文章
- CentOS7 编译安装golang和rpm安装golang
编译安装 1.下载golang二进制安装包: https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz 2.解压安装包到指定目录,此 ...
- linux安装git,linux安装jenkins
首先是两个地址,分别是git的版本下载地址,jenkins的下载地址 https://mirrors.edge.kernel.org/pub/software/scm/git/ http://mirr ...
- Linux下安装Mysql(RPM安装)
一.去官网下载本次安装须要的mysql版本号.我们须要安装的是5.1版本号的且centos系统是64位的.所下面载的是MySQL-community-5.1.73-1.rhel5.x86_64.rpm ...
- 【转】CentOS上安装 jdk:rpm安装和源码安装
1.安装 jdk-8u5-linux-x64.rpm 原文链接:http://www.cnblogs.com/xsi640/p/3756995.html 先下载最新的jdk版本 文件名:jdk-8u5 ...
- gitlab 源码安装=》rpm安装横向迁移(version 9.0)
准备: 下载版本地址: https://packages.gitlab.com/gitlab/gitlab-ce 迁移环境: 源码安装的gitlab9.0.13 目标迁移至9.0.13 RPM安装的环 ...
- Git入门(安装及基础命令行操作)
一.安装 1.Mac 在Mac中安装Git的方法不止一种.最简单的要数通过Xcode命令行工具.对于Mavericks(10.9)或更高版本的操作系统,当你第一次尝试在终端执行git命令时,系统会自动 ...
- windows安装git客户端
1:线上git地址 https://github.com/ 2:tortoiseGit地址 http://tortoisegit.org 3:安装步骤 操作系统:Windows XP SP3 Git客 ...
- Git简介和安装
一.什么是Git? Git是一个分布式版本控制系统,客户端并不只提取最新版本的文件快照,而是把代码仓库完整地镜像下来.如图所示: 任何一处的服务器或者个人机发生故障,都可以用其它机器的任何一个镜像出来 ...
- 在windows 环境下对于 git 服务器的安装和使用
前言: 虽然说在团队开发的时候会有版本控制服务器,但是个人自己开发的时候,有的时候也需要有个版本控制下,比如,你改好了一个小的功能,然后在这个功能上继续扩展,结果扩展不成功,于是回到这个小功能上去.当 ...
随机推荐
- 使用getline输入一行字符串
给定10个国家名,按字母顺序输出,国家名中可以包含空格,国家名用换行隔开 #include<algorithm> #include<iostream> #include< ...
- Android进阶推荐书籍
中级进阶推荐看一下以下这几本书 1.<Android从入门到精通(附光盘)> 明日科技 编 2.<第一行代码2 Android(第二版)> 郭霖 著 3.<Android ...
- cadence电源和地平面的处理
覆铜是PCB布线的常用操作,下面总结覆铜的方法以及电源层分割的方法 PCB设计中,经常面临电源.地噪声的挑战,在高速数字系统中,电源和地的设计非常关键!电源和地的主要作用有: 一,为数字信号提供稳定的 ...
- 上传文件格式,及headers设置
file[]:(binary)文件格式,传过去的参数自然是query string parameters 形式,当然也有纯的formData格式 formData格式就是将所有的参数append到p ...
- layui 表格内容显示更改
在cole 中使用temple 属性进行修改 例: table.render({ elem: '#messageTable' ,id: 'search_table_mId' ,height: 500 ...
- 使用abcpdf分页设置的问题
如果需要在分页时不对模块进行截断,请为相应模块添加打印样式“page-break-inside: avoid” 如果需要在指定位置进行强制分页,请添加:“<div style="pag ...
- 深入理解Spring Redis的使用 (九)、通过Redis 实现 分布式锁 的 BUG,以及和数据库加锁的性能测试
在多节点的项目中,经常要涉及到某些方法加锁的控制.而这个时候,简单易用的synchronized已经不能满足多节点的部署结构. 之前在项目中,用的比较多的是数据库的更新锁:for udpate.但是这 ...
- 什么是shell和终端?
目录 什么是shell? 什么是终端? 什么是shell? 当谈到命令时,我们实际上指的是shell.shell是一个接收由键盘输入的命令,并将其传递给操作系统来执行的程序.几乎所有的Linux发行版 ...
- [Swift]LeetCode115. 不同的子序列 | Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of S which equals T. A su ...
- [Swift]LeetCode250.计数相同值子树的个数 $ Count Univalue Subtrees
Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of ...