# 007-虚拟机或物理机部署GitlabRunner

作者:Odboy (opens new window)

本站地址:https://blog.odboy.cn (opens new window)

# 前言

容器化部署gitlab-runner有各种各样奇怪的问题,所以决定裸机部署

# 部署节点

192.168.235.105

# 写hosts记录

cat << EOF >> /etc/hosts
192.168.235.103 kenaito-redis.odboy.local
192.168.235.103 kenaito-mysql.odboy.local
192.168.235.103 kenaito-minio.odboy.local
192.168.235.103 kenaito-register.odboy.local
192.168.235.104 kenaito-gitlab.odboy.local
EOF
1
2
3
4
5
6
7

# 安装包

Gitlab Version Gitlab Url Runner Version Runner Url Download Url
17.5.2 wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-14.8.2-ce.0.el7.x86_64.rpm/download.rpm 17.5.2 https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v17.5.2 https://gitlab-runner-downloads.s3.amazonaws.com/v17.5.2/binaries/gitlab-runner-linux-amd64
14.8.2 wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-14.8.2-ce.0.el7.x86_64.rpm/download.rpm 14.8.2 https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v14.8.2 https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v14.8.2/downloads/binaries/gitlab-runner-linux-amd64

# 下载安装包

wget https://gitlab-runner-downloads.s3.amazonaws.com/v17.5.2/binaries/gitlab-runner-linux-amd64
1

# 部署配置GitlabRunner

cp gitlab-runner-linux-amd64 /usr/bin/gitlab-runner
chmod +x /usr/bin/gitlab-runner
1
2

jietu

# 配置为Service

# Create a GitLab Runner user
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
# Install and run as a service
#gitlab-runner会有各种权限问题
#sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner install --user=root --working-directory=/home/gitlab-runner
sudo gitlab-runner start
1
2
3
4
5
6
7

jietu

最近更新: 2024-12-19
2017 - 武林秘籍   |