Skip to content

Latest commit

 

History

History
91 lines (59 loc) · 3.2 KB

File metadata and controls

91 lines (59 loc) · 3.2 KB

GitLab-Runner Installation and Maintenance

https://docs.gitlab.com/runner/

Requirements

  • Elevated permissions

Installing

For installing on the ESDC corperate image follow the walk-through GitLab provides for installing on Windows. You should probably be downloading the amd64 binary.

Registering runners

You should register your runner to any project or group that you work on. If you do not have access to the runners settings ask the Owner of the Group or Maintainer of the Project you want to add it to, for the gitlab-ci token.

Environment variables

You will likely need to add environment variables for your runner. The environment variables should point to things that might be different on different computers.

In order to add environment variables, edit the config.toml file where you installed the gitlab-runner.exe and add something similar to the following line under executor for each runner you have registered.

environment = ["NUGET_PATH=C:\\Git\\NuGet\\NuGet.exe", "MSBUILD_PATH=C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\msbuild.exe"]

You should also add a tag (nuget & msbuild) to the runner for each environment variable you add. You may need to ask the Owner of the Group or Maintainer of the Project to update the tags on your runner though the GitLab UI.

Running PowerShell scripts

You may need your runner to be able to execute PowerShell scripts. In order to do that you will have to adjust the settings of the user account you run the runner with. To do so, open a powershell command line as the user you run the runner with, and execute the following line.

set-executionpolicy remotesigned -scope currentuser

You can view the settings for all users by running get-executionpolicy -list

Maintenance

We are looking into the option of writing a script that would do all this for you.

Logon as a service

Sometimes after rebooting your computer, the runner will turn off and you will need to give the user permissions to "logon as a service". To do that:

  • Run Services with elevated permissions
  • Go to the Properties of gitlab-runner service
  • Go to Log On and re-enter your Password
  • Click OK
  • Click Start

Updates

Check every few months for updates (put a reminder in your calendar) and follow the instructions.
https://docs.gitlab.com/runner/install/windows.html#update

Notes

Installing on a Server - trial mode

We've installed a Runner on a server currently as a trial, this is here to document what changes were made to get it to work.
Secrets can't be added to a runner on a server

Software Installed

  • Notepad++
  • GitLab-Runner
  • Git
  • Node.js
  • MSBuild CLI Tools
  • NuGet

User Configurations Setup

  • Standard user created
  • Standard user configured with startup script to void the npm proxy settings
  • Standard user granted "Logon as a Service" rights
  • Standard user execution policy set to remotesigned on scope of currentuser
  • Standard user granted ownership of GitLab-Runner install folder

Sever Settings

  • Mapped deploy folders