[转]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 服务器的安装和使用
前言: 虽然说在团队开发的时候会有版本控制服务器,但是个人自己开发的时候,有的时候也需要有个版本控制下,比如,你改好了一个小的功能,然后在这个功能上继续扩展,结果扩展不成功,于是回到这个小功能上去.当 ...
随机推荐
- mybatis invalid comparison: java.sql.Timestamp and java.lang.String报错解决方法
这个错的意思是:java.sql.Timestamp和java.lang.String无效的比较 错误的原因是:拿传入的时间类型参数与空字符串进行比较就会报这个异常 解决方法:只保留非null判断就可 ...
- centos7搭建本地 Remix
由于最近要弄加入某联盟链,是基于ETH 所以要弄一个开发环境 一.准备 安装 nodejs,npm,git 二.安装 git clone https://github.com/ethereum/rem ...
- node 重新安装依赖模块
rm -rf node_modules rm package-lock.json npm cache clear --force npm install
- js将一篇文章中多个连续的<br>标签替换成两个连续的<br>标签
写本文的目的是今天恰好有一个之前做SEO的同事问我怎样把一篇文章中多个连续的br标签替换成两个连续的br标签,这里就牵涉到SEO层面的问题了. 在做SEO优化的时候,其中有一个需要注意的地方就是尽量减 ...
- 使用Ant Design的select组件时placeholder不生效/不起作用的解决办法
先来说说使用Ant Design和Element-ui的感觉吧. 公司的项目开发中用的是vue+element-ui,使用了一通下来后,觉得element-ui虽然也有一些问题或坑,但这些小问题或坑凭 ...
- Reveal : Xcode辅助界面调试工具
Reveal简介: Reveal是一款iOS界面调试工具,辅助Xcode进行界面调试,使用它可以在iOS开发的时候动态的查看和修改应用程序的界面. 软件下载 首先去官网下载Reveal,下载地址:ht ...
- vue中添加title中的小图标
webpack.prod.conf.js 这个文件中: 引入代码const path = require('path') :下面是进行配置: new HtmlWebpackPlugin({ filen ...
- mongodb的几种运算符
①比较运算符: 等于:默认是等于判断,没有运算符 小于:$lt(less than) 小于等于:$lte(less than equal) 大于:$gt(greater than) 大于等于:$gte ...
- DCOS实践分享(5):Open DCOS深入分析
2016/05/18(三) 09:30 OpenDC/OS研討會暨工作坊 指導單位:經濟部.科技部 主辦單位:工業技術研究院.Linker Networks 協辦單位:Microsoft.資通訊產業聯 ...
- Hash及HashMap简介
Hash简介: Hash,一般翻译做“散列”,也有直接音译为“哈希”的,就是把任意长度的输入(又叫做预映射pre-image)通过散列算法变换成固定长度的输出,该输出就是散列值.这种转换是一种压缩映射 ...