在windows上安装GitLab

本文档详述了如何在Windows环境下安装并运行GitLab Runner,包括创建文件夹存放二进制文件、注册Runner、安装服务及启动流程,并提供了使用内置系统帐户或指定用户帐户运行服务的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Install GitLab Runner on Windows

To install and run GitLab Runner on Windows you need:

  • Git installed
  • A password for your user account, if you want to run it under your user account rather than the Built-in System Account

Installation 

Important: With GitLab Runner 10, the executable was renamed to  gitlab-runner. If you want to install a version prior to GitLab Runner 10,  visit the old docs.
  1. Create a folder somewhere in your system, ex.: C:\GitLab-Runner.
  2. Download the binary for x86 or amd64 and put it into the folder you created. Rename the binary to gitlab-runner.exe. You can download a binary for every available version as described in Bleeding Edge - download any other tagged release.
  3. Run an Administrator/elevated command prompt (WindowsKey, search for "cmd", right click and run as admin).
  4. Register the Runner.
  5. Install the Runner as a service and start it. You can either run the service using the Built-in System Account (recommended) or using a user account.

    Run service using Built-in System Account

    gitlab-runner install
    gitlab-runner start
    

    Run service using user account

    You have to enter a valid password for the current user account, because it's required to start the service by Windows:

    gitlab-runner install --user ENTER-YOUR-USERNAME --password ENTER-YOUR-PASSWORD
    gitlab-runner start
    

    See the troubleshooting section if you encounter any errors during the Runner installation.

  6. (Optional) Update Runners concurrent value in C:\GitLab-Runner\config.toml to allow multiple concurrent jobs as detailed in advanced configuration details. Additionally you can use the advanced configuration details to update your shell executor to use Bash or PowerShell rather than Batch.

Voila! Runner is installed, running, and will start again after each system reboot. Logs are stored in Windows Event Log.

Update 

  1. Stop the service (you need elevated command prompt as before):

    cd C:\GitLab-Runner
    gitlab-runner stop
    
  2. Download the binary for x86 or amd64 and replace runner's executable. You can download a binary for every available version as described in Bleeding Edge - download any other tagged release.

  3. Start the service:

    gitlab-runner start
    

Uninstall 

From elevated command prompt:

cd C:\GitLab-Runner
gitlab-runner stop
gitlab-runner uninstall
cd ..
rmdir /s GitLab-Runner

Troubleshooting 

Make sure that you read the FAQ section which describes some of the most common problems with GitLab Runner.

If you encounter an error like The account name is invalid try to add .\ before the username:

gitlab-runner install --user ".\ENTER-YOUR-USERNAME" --password "ENTER-YOUR-PASSWORD"

If you encounter a The service did not start due to a logon failure error while starting the service, please look in the FAQ to check how to resolve the problem.

If you don't have a Windows Password, Runner's service won't start but you can use the Built-in System Account.

If you have issues with the Built-in System Account, please read How to Configure the Service to Start Up with the Built-in System Account on Microsoft's support website.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值