Chocolatey Fest - Chocolatey's inaugural conference on Windows Automation (WinOps) is coming - Learn more!

This is a prerelease version of Gitlab Runner.

Gitlab Runner

11.0.0-rc1

Package test results are passing.

There are versions of this package awaiting moderation . See the Version History section below.

This package was approved as a trusted package on 6/13/2018.

GitLab Runner is the open source project that is used to run your jobs and send the results back to GitLab. It is used in conjunction with GitLab CI, the open-source continuous integration service included with GitLab that coordinates the jobs.

Features

  • Allows to run:

    • multiple jobs concurrently

    • use multiple tokens with multiple server (even per-project)

    • limit number of concurrent jobs per-token

  • Jobs can be run:

    • locally

    • using Docker containers

    • using Docker containers and executing job over SSH

    • using Docker containers with autoscaling on different clouds and virtualization hypervisors

    • connecting to remote SSH server

  • Is written in Go and distributed as single binary without any other requirements
  • Supports Bash, Windows Batch and Windows PowerShell
  • Works on GNU/Linux, OS X and Windows (pretty much anywhere you can run Docker)
  • Allows to customize the job running environment
  • Automatic configuration reload without restart
  • Easy to use setup with support for Docker, Docker-SSH, Parallels or SSH running environments
  • Enables caching of Docker containers
  • Easy installation as a service for GNU/Linux, OSX and Windows
  • Embedded Prometheus metrics HTTP server

Package parameters

  • /InstallDir - Installation directory. If the Gitlab Runner is already installed, its current directory will be used. To install to a new directory, uninstall it first.
  • /Service - Install as a service. If value is not specified system account will be used. If value is specified it is in the form of Username:Password. The installer will create that user if it doesn't exist, add it to local administrators group, enable ServiceLogonRight and disable password expiration. Example: /Service:gitlab-runner:[email protected]. Can't be used with Autologon parameter
  • /Autologon - Use autologon feature of Windows. Can't be used with Service parameter. Username and password must be provided. Example: /Autologon:gitlab-runner:[email protected].

Notes

  • The script register_example.ps1 is provided along the executable which can be used to quickly register runner non-interactively. If you want to use it, rename it to register.ps1 and set desired environment variables.
  • Autologon vs Service: Services do not have access to all Windows features and some scripts, particularly those that depend on GUI, are not usable.

To install Gitlab Runner, run the following command from the command line or from PowerShell:

C:\> choco install gitlab-runner --pre

To upgrade Gitlab Runner, run the following command from the command line or from PowerShell:

C:\> choco upgrade gitlab-runner --pre

Files

Hide
  • legal\LICENSE.txt Show
    The MIT License (MIT)
    
    Copyright (c) 2015-2017 GitLab B.V.
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
    
  • legal\VERIFICATION.txt Show
    VERIFICATION
    
    Verification is intended to assist the Chocolatey moderators and community
    in verifying that this package's contents are trustworthy.
    
    Package can be verified like this:
    
    1. Go to
    
       x32: https://gitlab-runner-downloads.s3.amazonaws.com/v11.0.0-rc1/binaries/gitlab-runner-windows-386.exe
       x64: https://gitlab-runner-downloads.s3.amazonaws.com/v11.0.0-rc1/binaries/gitlab-runner-windows-amd64.exe
    
       to download the installer.
    
    2. You can use one of the following methods to obtain the SHA256 checksum:
       - Use powershell function 'Get-FileHash'
       - Use Chocolatey utility 'checksum.exe'
    
       checksum32: 300C0ACEECF0A2D53253557AAA1F67DC84796C4AFF045BF004283520A8FAB3FC
       checksum64: AE551BFF01B46978E2356AD87B87253245ACB00385871E113612FA496A44C884
    
    
    File 'license.txt' is obtained from:
       https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/raw/master/LICENSE
    
  • tools\autologon.xml Show
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
      <RegistrationInfo>
        <Author>DESKTOP-9Q3PK5G\majkinetor</Author>
        <URI>\autologon</URI>
      </RegistrationInfo>
      <Triggers>
        <LogonTrigger>
          <Enabled>true</Enabled>
          <UserId>DESKTOP-9Q3PK5G\gitlab-runner</UserId>
        </LogonTrigger>
      </Triggers>
      <Principals>
        <Principal id="Author">
          <UserId>DESKTOP-9Q3PK5G\gitlab-runner</UserId>
          <LogonType>InteractiveToken</LogonType>
          <RunLevel>HighestAvailable</RunLevel>
        </Principal>
      </Principals>
      <Settings>
        <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
        <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
        <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
        <AllowHardTerminate>true</AllowHardTerminate>
        <StartWhenAvailable>false</StartWhenAvailable>
        <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
        <IdleSettings>
          <StopOnIdleEnd>true</StopOnIdleEnd>
          <RestartOnIdle>false</RestartOnIdle>
        </IdleSettings>
        <AllowStartOnDemand>true</AllowStartOnDemand>
        <Enabled>true</Enabled>
        <Hidden>false</Hidden>
        <RunOnlyIfIdle>false</RunOnlyIfIdle>
        <WakeToRun>false</WakeToRun>
        <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
        <Priority>7</Priority>
      </Settings>
      <Actions Context="Author">
        <Exec>
          <Command>C:\gitlab-runner\autologon.bat</Command>
        </Exec>
      </Actions>
    </Task>
  • tools\chocolateyBeforeModify.ps1 Show
    Get-Service gitlab-runner -ea 0 | Stop-Service
    ps gitlab-runner -ea 0 | kill
    
  • tools\chocolateyInstall.ps1 Show
    $ErrorActionPreference = 'Stop'
    
    $toolsPath = Split-Path $MyInvocation.MyCommand.Definition
    . $toolsPath\helpers.ps1
    
    $pp = Get-PackageParameters
    
    $current_dir = Get-RunnerInstallDir
    if ($current_dir) {
        Write-Host 'Using previous gitlab-runner install path:' $current_dir
        $pp.InstallDir = $current_dir
    } else {
        if (!$pp.InstallDir) { $pp.InstallDir = "c:\gitlab-runner" }
        Write-Host 'Using install directory:' $pp.InstallDir
    }
    $installDir = $pp.InstallDir
    
    $is64 = (Get-ProcessorBits 64) -and $env:chocolateyForceX86 -ne 'true'
    $runner_embedded = if ($is64) { Write-Host "Installing x64 bit version"; gi $toolsPath\*_x64.exe } else { Write-Host "Installing x32 bit version"; gi $toolsPath\*_x32.exe }
    
    mkdir $installDir -ea 0 | Out-Null
    mv $runner_embedded, $toolsPath\register_example.ps1 $installDir -force
    ls $toolsPath\*.exe | % { rm $_ -ea 0; if (Test-Path $_) { touch "$_.ignore" }}
    mv $installDir\gitlab*.exe $installDir\gitlab-runner.exe -Force
    
    $runner_path = Join-Path $installDir 'gitlab-runner.exe'
    Install-BinFile gitlab-runner $runner_path
    
    if ($pp.Service) {
        if ($pp.Autologon) { throw 'Autologon and Service parameters are mutually exclusive' }
    
        if ($pp.Service -is [string]) { 
            $Username, $Password = $pp.Service -split ':'
            if (!$Password) { throw 'When specifying service user, password is required' } 
        }
    
        Write-Host "Installing gitlab-runner service"
        $cmd = "$runner_path install"
        if ($Username) {
            Add-User $Username $Password
            Add-ServiceLogonRight $Username
            $cmd += " --user $Env:COMPUTERNAME\$Username --password $Password" 
        }
        iex $cmd
    
        Write-Host "Starting service"
        iex "$runner_path start"
    }
    
    if ($pp.Autologon) { 
        if ($pp.Service) { throw 'Autologon and Service parameters are mutually exclusive' }
        
        $Username, $Password = $pp.Autologon -split ':'
        if (!$Password) { throw 'When specifying autologon user, password is required' } 
        
        Add-User $Username $Password
    
        Write-Host "Setting autologon for $Username"
        Set-AutoLogon $Username $Password 
        
        Write-Host "Creating logon script: $installDir\autologon.bat"
        "cd ""$installDir""`n" +
        """$installDir\gitlab-runner.exe"" run" | Out-File $installDir\autologon.bat -Encoding ascii
    
        Write-Host "Creating scheduled task: autologon"
        [xml] $xml = gc $toolsPath\autologon.xml -Encoding Ascii
        $xml.Task.RegistrationInfo.Author       = "$Env:COMPUTERNAME\$Env:USERNAME"
        $xml.task.Triggers.LogonTrigger.UserId  = "$Env:COMPUTERNAME\$Username"
        $xml.task.Principals.Principal.UserId   = "$Env:COMPUTERNAME\$Username"
        $xml.task.Actions.Exec.Command          = "$installDir\autologon.bat"
        $xml.Save( "$toolsPath\autologon.xml" )
    
        schtasks.exe /Create /XML "$toolsPath\autologon.xml" /Tn autologon /F
        if ($LASTEXITCODE) { throw "Scheduled task not created ($LastExitCode)" }
    }
    
  • tools\chocolateyUninstall.ps1 Show
    $toolsPath = Split-Path $MyInvocation.MyCommand.Definition
    . $toolsPath\helpers.ps1
    
    if (gsv gitlab-runner -ea 0) {
        gitlab-runner.exe stop
        gitlab-runner.exe uninstall
    }
    
    $installDir = Get-RunnerInstallDir
    
    Write-Warning 'If a gitlab-runner user is created during the installation, it is not removed as a safety measure'
    Write-Warning '  to remove it execute: net user gitlab-runner /delete'
    Write-Warning 'If Autologon parameter was used when installing, disable autolog manually'
    
    # It might not be safe to just rm -Force -Recursive, let the user do it manually.
    if ($installDir) {
        Write-Warning "Gitlab-runner remained installed in $installDir"
        Write-Warning "  to delete it execute: rm '$installDir' -Force -Recurse"
    } else {
        Write-Warning "Can't find gitlab-runner installation directory, please remove it manually"
    }
  • tools\gitlab-runner-windows-386_x32.exe Show
    md5: F40B776D02544754BED8E36E99CDCDFE | sha1: 2D5651337D8477763CD7E8AA3C575180573DB631 | sha256: 300C0ACEECF0A2D53253557AAA1F67DC84796C4AFF045BF004283520A8FAB3FC | sha512: EF060EDF3EAD27130345B9D9A4E277527A7287799293DB916F97F542E0774E5311C9671C4B63A5BAF3A97F9BA10C0F67AF8E9DD3C5820FE6E7460447CAFBD788
  • tools\gitlab-runner-windows-amd64_x64.exe Show
    md5: A85F6E20FCBCD04DDF846850CE8B3265 | sha1: 63707EB2F11FFEED287D934803291FC258C745C8 | sha256: AE551BFF01B46978E2356AD87B87253245ACB00385871E113612FA496A44C884 | sha512: 8F310C5117FA4FE734D183C5AE331696780F9A5EADDA2C2111D9D97BDD4B6C2ECFF008A161700B9996E8B79A35D97F72DF6A9129E0E1E9E2120E4ED5EECA2D52
  • tools\helpers.ps1 Show
    function Get-RunnerInstallDir() {
        $res = Get-WmiObject win32_service | ? {$_.Name -eq 'gitlab-runner'} | select -Expand PathName
        if (!$res) { 
            if (!(gcm gitlab-runner.exe -ea 0)) { return }
            $res = (gitlab-runner.exe --shimgen-help 2>&1) -match '^\s*Target:' -replace "Target:|'"
            $res = $res.Trim()
        }
        $res = $res -split '\\gitlab-runner.exe' | select -First 1
        if (Test-Path $res) { return $res }
    }
    
    function Add-ServiceLogonRight([string] $Username) {
        Write-Host "Enable ServiceLogonRight for $Username"
        
        $tmp = [System.IO.Path]::GetTempFileName()
        secedit /export /cfg "$tmp.inf" | Out-Null
        (gc -Encoding ascii "$tmp.inf") -replace '^SeServiceLogonRight .+', "`$0,$Username" | sc -Encoding ascii "$tmp.inf"
        secedit /import /cfg "$tmp.inf" /db "$tmp.sdb" | Out-Null
        secedit /configure /db "$tmp.sdb" /cfg "$tmp.inf" | Out-Null
        rm $tmp* -ea 0
    }
    
    function Add-User([string] $Username, [string] $Password ) {
        $user = Get-WmiObject win32_useraccount -Filter { LocalAccount = 'true' } | ? { $_.Name -eq $Username }
        if ($user) { Write-Host "User $Username already exists"; return } 
    
        Write-Host "Creating user $Username as local administrator"
        net user $Username $Password /add | Out-Null
        net localgroup Administrators $Username /add | Out-NUll
        $user = Get-WmiObject win32_useraccount -Filter { LocalAccount = 'true' } | ? { $_.Name -eq $Username }
        $user.PasswordExpires = $false
    }
    
    
    # Author: Miodrag Milic <[email protected]>
    # Last Change: 23-Jun-2016.
    
    <#
    .SYNOPSIS
        Set Windows to automatically login as given user after restart and eventually execute a script
    
    .DESCRIPTION
        Enable AutoLogon next time when the server reboots.
        It can trigger a specific Script to execute after the server is back online after Auto Logon.
    
    .EXAMPLE
        Set-AutoLogon -Username "domain\user" -Password "my password"
    
    .EXAMPLE
        Set-AutoLogon -Username "domain\user" -Password "my password" -LogonCount 3
    
    .EXAMPLE
        Set-AutoLogon -Username "domain\user" -Password "my password" -Script "c:\test.bat"
    .LINK
        https://github.com/majkinetor/posh/blob/master/MM_Admin/Set-AutoLogon.ps1
    #>
    function Set-AutoLogon {
        [CmdletBinding()]
        Param(
            #Provide the username that the system would use to login.
            [Parameter(Mandatory=$true)]
            [String]$Username,
    
            #Provide the Password for the User provided.
            [Parameter(Mandatory=$true)]
            [String]$Password,
    
            #Sets the number of times the system would reboot without asking for credentials, by default 100000.
            [String]$LogonCount=100000,
    
            #Script: Provide Full path of the script for execution after server reboot
            [String]$Script
        )
    
        $ErrorActionPreference = 'Stop'
    
        $RegPath   = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
        $RegROPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
    
        Set-ItemProperty $RegPath "AutoAdminLogon"  -Value 1
        Set-ItemProperty $RegPath "DefaultUsername" -Value $Username
        Set-ItemProperty $RegPath "DefaultPassword" -Value $Password
        #Set-ItemProperty $RegPath "DefaultDomain" -Value $Env:USERDOMAIN
    
        $v = if ($LogonCount)  { $LogonCount } else { '' }
        Set-ItemProperty $RegPath "AutoLogonCount" -Value $v -Type DWord
    
        $v = if ($Script)  { $Script } else { '' }
        Set-ItemProperty $RegROPath "Set-Autologon" -Value $v
    }
    
  • tools\register_example.ps1 Show
    <# 
        Rename this file to register.ps1 or it will get overwritten by the future updates.
        For the list of all environment vars run `gitlab-runner register --help`
        Running runners should automatically pick up config.toml changes.
    #>
    
    $Env:RUNNER_NAME                = ''
    $Env:REGISTRATION_TOKEN         = ''
    $Env:CI_SERVER_URL              = ''
    $Env:RUNNER_TAG_LIST            = ''        #comma separated list of tags
    
    $Env:CONFIG_FILE                = "$PSScriptRoot\config.toml"
    $Env:REGISTER_RUN_UNTAGGED      = 'false'
    $Env:REGISTER_LOCKED            = $false    #lock runner to current project 
    $Env:RUNNER_EXECUTOR            = 'shell'
    $Env:RUNNER_SHELL               = 'powershell'
    
    $Env:RUNNER_REQUEST_CONCURRENCY = 1
    $Env:RUNNER_BUILDS_DIR          = ''
    $Env:RUNNER_CACHE_DIR           = ''
    
    
    gitlab-runner register --non-interactive
    

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

Package Maintainer(s)

Software Author(s)

  • Gitlab

Copyright

GitLab

Tags

Release Notes

https://gitlab.com/gitlab-org/gitlab-runner/blob/master/CHANGELOG.md

Version History

Version Downloads Last updated Status
Gitlab Runner 11.0.0 2 Saturday, June 23, 2018 submitted
Gitlab Runner 11.0.0-rc1 30 Wednesday, June 13, 2018 approved
Gitlab Runner 10.8.0-rc1 27 Friday, May 11, 2018 approved
Gitlab Runner 10.7.0-rc1 137 Thursday, April 12, 2018 approved
Gitlab Runner 10.6.0 610 Friday, March 23, 2018 approved
Gitlab Runner 10.6.0-rc1 56 Friday, March 9, 2018 approved
Gitlab Runner 10.5.0 360 Friday, February 23, 2018 approved
Gitlab Runner 10.5.0-rc1 56 Friday, February 9, 2018 approved
Gitlab Runner 10.4.0 337 Monday, January 22, 2018 approved
Show More

Discussion for the Gitlab Runner Package

Ground rules:

  • This discussion is only about Gitlab Runner and the Gitlab Runner package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Gitlab Runner, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus
Chocolatey.org uses cookies to enhance the user experience of the site.
Ok