Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install and configure gitlab-runner in linux

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Introduction to gitlab-runner:

GitLab-Runner is used in conjunction with GitLab-CI. Generally, every project in GitLab defines a software integration script that belongs to the project, which is used to automate some software integration work. When the warehouse code of the project changes, for example, someone push the code, GitLab will notify GitLab-CI of the change. At this point, GitLab-CI finds the Runner associated with the project and tells the Runner to update the code locally and execute the predefined execution script.

So, GitLab-Runner is something that executes software integration scripts. You can imagine: Runner is like individual workers, and GitLab-CI is a management center for these workers. All workers have to register in GitLab-CI and indicate which project they work for. When the corresponding project changes, GitLab-CI will notify the appropriate workers to execute the software integration script.

GNU / Linux install gitlab-runner:

It is installed on a server different from the location where GitLab is installed.

1. Download gitlab-runner binary executable source file x86-64

Sudo wget-O / usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64

two。 Give executable permissions to the source file

Sudo chmod + x / usr/local/bin/gitlab-runner

3. Create a gitlab-runner user

Sudo useradd-- comment 'GitLab Runner'-- create-home gitlab-runner-- shell / bin/bash

4. Install, start

Sudo gitlab-runner install-user=gitlab-runner-working-directory=/home/gitlab-runner

Script execution user and gitlab-runner working directory can be specified during installation

Sudo gitlab-runner start

Obtain tokens and gitlab server domain names for shared or specific Runner through the interface of GitLab

(enter gitlab Project-> Settings-> CI/CD- > Runners- > Setup a specific Runner manually)

1. Register

Sudo gitlab-runner register

two。 Enter the relevant configuration according to the prompt

Please enter the gitlab-ci coordinator URL (e.g. Https://gitlab.com)

Https://gitlab.com (enter GitLab instance URL)

Please enter the gitlab-ci token for this runner

Xxx (enter runner registration token)

Please enter the gitlab-ci tags for this runner (comma separated):

My-tag (input runner tag can be modified on the UI page of gitlab)

Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:

Shell (enter the runner script execution environment)

After successful registration of this project in gitlab

On the Settings-> CI/CD- > Runners page, a new runner tag tag appears as the tag tag content you just entered.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report