[转]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 服务器的安装和使用
前言: 虽然说在团队开发的时候会有版本控制服务器,但是个人自己开发的时候,有的时候也需要有个版本控制下,比如,你改好了一个小的功能,然后在这个功能上继续扩展,结果扩展不成功,于是回到这个小功能上去.当 ...
随机推荐
- nginx连接数优化
一.一般来说nginx 配置文件中对优化比较有作用的为以下几项: 1. worker_processes 8; nginx 进程数,建议按照cpu 数目来指定,一般为它的倍数 (如,2个四核的cpu计 ...
- Content-Type: application/www-form-urlencoded
默认的方式 1.Content-Type: application/www-form-urlencoded id=3&fgf=56&908rr=767 2.Content-Type:a ...
- 线程(Thread、ThreadPool)
多线程的操作,推荐使用线程池线程而非新建线程.因为就算只是单纯的新建一个线程,这个线程什么事情也不做,都大约需要1M的内存空间来存储执行上下文数据结构,并且线程的创建与回收也需要消耗资源,耗费时间.而 ...
- ubuntu 修改系统时间无效
用root用户修改服务器时间无效:使用hwclock -w也不行 解决方法: 需要取消自动从互联网同步时间才可以的 timedatectl set-ntp 0 上面的命令可以关闭自动同步,然后你再设置 ...
- NeuChar 平台使用及开发教程(四):使用 NeuChar 的素材服务
各类公众号的功能之一就是为用户提供各类图文和多媒体的信息,因此素材是必不可少的. 进入 Neural Cell 设置界面,点击右侧[素材管理]按钮,进入素材管理界面. 目前系统提供了文本.多图文.图片 ...
- [Swift]LeetCode97. 交错字符串 | Interleaving String
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1: Input: s1 = ...
- [SQL]LeetCode175. 组合两个表 | Combine Two Tables
Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | PersonId ...
- Java数据结构和算法 - 什么是2-3-4树
Q1: 什么是2-3-4树? A1: 在介绍2-3-4树之前,我们先说明二叉树和多叉树的概念. 二叉树:每个节点有一个数据项,最多有两个子节点. 多叉树:(multiway tree)允许每个节点有更 ...
- python高级-动态特性(20)
一.动态语⾔的定义 动态语言是在运行时确定数据类型的语言.变量使用之前不需要类型声明,通常变量的类型是被赋值的那个值的类型.现在比较热门的动态语言有:Python.PHP.JavaScript.Obj ...
- 12.Flask-Restful
定义Restful的视图 安装:pip install flask-restful 如果使用Flask-restful,那么定义视图函数的时候,就要继承flask_restful.Resourse类, ...