[转]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 服务器的安装和使用
前言: 虽然说在团队开发的时候会有版本控制服务器,但是个人自己开发的时候,有的时候也需要有个版本控制下,比如,你改好了一个小的功能,然后在这个功能上继续扩展,结果扩展不成功,于是回到这个小功能上去.当 ...
随机推荐
- MD5加密过时方法替换
使用System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile进行MD5加密时,会出现已过时 /// < ...
- [LeetCode] Loud and Rich 聒噪与富有
In a group of N people (labelled 0, 1, 2, ..., N-1), each person has different amounts of money, and ...
- Linux一键安装宝塔控制面板
Linux一键安装宝塔的命令行 yum install -y wget && wget -O install.sh http://download.bt.cn/install/inst ...
- wordpress安装插件和主题
一.建立ftp服务器: 安装:sudo apt-get install vsftpd 配置:sudo nano /etc/vsftpd.conf 本地写入的注释去掉,可以写入的注释去掉 重启服务: s ...
- js计算指定日期的下一年的日期
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Docker的基本概念
Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化.容器是完全使用沙箱机制,相互之间不会有任何 ...
- APP研发录笔记
一.消灭全局变量 在内存不足时,系统会回收一部分闲置的资源,由于App被切换到后台,所以之前存放的全局变量很容易被回收,这时再切换到前台继续使用,会报空指针崩溃.想彻底解决这个问题,就要使用序列化. ...
- Lesson 26 The best art critics
Text I am an art student and I paint a lot of pictures. Manay people pretend that they understand mo ...
- CS231n 第一次作业KNN中本地CIFAR10数据集的载入
一.问题描述 网上绝大多数作业参考都是在jupyter下运行的,数据集载入过程一般如下: from cs231n.data_utils import load_CIFAR10 #导入数据集,并打印出数 ...
- [Swift]LeetCode13. 罗马数字转整数 | Roman to Integer
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 ...