User Tools

Site Tools


kb:bestpractices:ci:gitlab-runner

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
kb:bestpractices:ci:gitlab-runner [2019/11/10 21:04]
joerg.hampel
kb:bestpractices:ci:gitlab-runner [2019/11/11 10:21] (current)
joerg.hampel
Line 3: Line 3:
 ===== Installation ===== ===== Installation =====
  
-Howto: ​[[https://​gitlab.com/​gitlab-org/​gitlab-ci-multi-runner/​blob/​master/​docs/​install/​windows.md|Install on Windows]]+//Taken from [[https://​gitlab.com/​gitlab-org/​gitlab-runner/​blob/​master/​docs/​install/​windows.md|Install on Windows]]//
  
-===== Running ===== 
  
-  ​* Run the executable from cmd prompt instead of installing a service. That wayall windows and dialogues are visible and the behaviour is much easier ​to follow and debug.  +  ​- Create ​folder somewhere in your systemex.: ''​C:​\GitLab-Runner''​. 
-  ​* Create ​shortcut and add it to the auto-start items.+  - Download the binary for [[https://​gitlab-runner-downloads.s3.amazonaws.com/​latest/​binaries/​gitlab-runner-windows-386.exe|x86]] <​del>​or amd64</​del> ​and put it into the folder you created. Rename ​the binary ​to gitlab-runner.exe
 +  ​- Run an [[https://​docs.microsoft.com/​en-us/​powershell/​scripting/​getting-started/​starting-windows-powershell?​view=powershell-6#​with-administrative-privileges-run-as-administrator|elevated command prompt]] 
 +  - [[https://​gitlab.com/​gitlab-org/​gitlab-runner/​blob/​master/​docs/​register/​index.md#​windows|Register the Runner]]. 
 +    - [[https://​docs.gitlab.com/​ee/​ci/​runners/​|Obtain ​token]] 
 +    - Run ''​./​gitlab-runner.exe register''​ 
 +    - Enter your GitLab instance URL (''​https://​gitlab.com''​) 
 +    - Enter the token you obtained ​to register ​the Runner 
 +    ​Enter a description for the Runner 
 +    - Enter the tags associated with the Runner 
 +    - Enter the Runner executor (''​shell''​)
  
-**Link Target:** 
  
-    C:​\GitLab-Runner\gitlab-runner.exe run --working-directory C:​\GitLab-Runner --config C:​\GitLab-Runner\config.toml --syslog --user admin 
  
-<WRAP left round tip 60%> 
-Runner has to be executed as //admin// in order for the keys in ''​C:​\Users\admin\.ssh''​ to be found! 
-</​WRAP>​ 
  
  
Line 29: Line 32:
 ==== Basics ==== ==== Basics ====
  
-//Config file at ''​C:​\Multi-runner\config.toml''//​+//Config file at ''​C:​\Gitlab-Runner\config.toml''//​
  
     concurrent = 1     concurrent = 1
Line 41: Line 44:
     executor = shell     executor = shell
  
-==== Token ====+=== Token ===
  
 Run gitlab-runner. This will result in a Runner being listed in the "​Runners activated for this project"​. The registered runner should say unavailable. Click the edit icon to the right of the runner and you'll find the token you need for your config.toml file.  Run gitlab-runner. This will result in a Runner being listed in the "​Runners activated for this project"​. The registered runner should say unavailable. Click the edit icon to the right of the runner and you'll find the token you need for your config.toml file. 
  
  
-==== Environment Variables ​====+ 
 +=== Environment Variables ===
  
     environment = ["​ENV1=value1",​ "​ENV2=value2"​]     environment = ["​ENV1=value1",​ "​ENV2=value2"​]
  
-  * ''​LABVIEW_2016_EXE'':​ LabVIEW .exe to be used 
-    * (Default: ''​C:​\\Program Files (x86)\\National Instruments\\LabVIEW 2016\\LabVIEW.exe''​) 
   * ''​TOOLS_FOLDER'':​ Directory that the build tools are pulled into   * ''​TOOLS_FOLDER'':​ Directory that the build tools are pulled into
-    * (Default: ''​C:​\\Multi-runner\\tools''​)+    * (Default: ''​C:​\\Gitlab-Runner\\tools''​)
  
  
 +---- 
  
-==== Example ​====+===== Running =====
  
-//Config file at ''​C:​\Multi-runner\config.toml''//​+  * Run the executable from a cmd prompt instead of installing a service. That way, all windows and dialogues are visible and the behaviour is much easier to follow and debug.  
 +  * Create a shortcut and add it to the auto-start items.
  
- concurrent = 1+**Link Target:** 
 + 
 +    C:​\GitLab-Runner\gitlab-runner.exe run --working-directory C:​\GitLab-Runner --config C:​\GitLab-Runner\config.toml --syslog --user admin 
 + 
 +<WRAP left round tip 60%> 
 +Runner has to be executed as //admin// in order for the keys in ''​C:​\Users\admin\.ssh''​ to be found! 
 +</​WRAP>​ 
 + 
 + 
 +----  
 + 
 +===== Example Config ===== 
 + 
 +//Config file at ''​C:​\Gitlab-Runner\config.toml''//​ 
 + 
 + concurrent = 
 + check_interval = 10
   
  [[runners]]  [[runners]]
-   name = "<%runner-description%>​+   name = "vsphere-lv2018
-   url = "<​%runner-url%>​+   url = "https://​gitlab.com/​
-   token = "<​%runner-token%>​"+   token = "xxxxxxxxxxxxxxxxxxx" 
 +   limit = 1
    executor = "​shell"​    executor = "​shell"​
-   environment = ["LABVIEW_2016_EXE=<​%path%>​\\LabVIEW.exe","​TOOLS_FOLDER=<​%path%>​\\tools"​] +   environment = [ "TOOLS_FOLDER=C:\\GitLab-Runner\\tools"​ ] 
-   ​[runners.ssh] +   ​disable_verbose=false
-   [runners.docker] +
-     tls_verify = false +
-     image = ""​ +
-     privileged = false +
-     disable_cache = false +
-   [runners.parallels] +
-     base_name = ""​ +
-     disable_snapshots = false +
-   [runners.virtualbox] +
-     base_name = ""​ +
-     disable_snapshots ​= false+
    [runners.cache]    [runners.cache]
-     ​Insecure ​= false+     ​insecure ​= false 
kb/bestpractices/ci/gitlab-runner.1573419894.txt.gz · Last modified: 2019/11/10 21:04 by joerg.hampel