Windows-Python-PyInstaller GitLab CI Runner

Posted on Wed 16 November 2016 in blog

Here I'll explain how to configure a Windows Server VM to act as a Python (PyInstaller) build server, running as a GitLab CI runner.

Procedure

Install Windows Server 2012 R2 "Server Core"

This is left as an exercise to the reader :-)

Enable Remote Desktop

Simply follow this detailed guide:

Windows 2012 Core Survival Guide – Remote Desktop

Set up GitLab CI Runner

  • Create home directory
    c:\users\gitlab-runner\
  • Create gitlab-runner account
    net user gitlab-runner P@55w0rd
  • Grant permissions to the home directory
    icacls c:\users\gitlab-runner gitlab-runner:(CI)(OI)(F)
  • Use secedit to add SeServiceLogonRight to user
  • gitlab-ci-multi-runner install --user .\gitlab-runner --password P@55w0rd
  • wmic useraccount GET Name,FullName,Status,Disabled,PasswordExpires /all
  • wmic useraccount WHERE "Name='gitlab-runner'" SET PasswordExpires=FALSE

Install Python

  • Install 32-bit MSI to C:\Python27_32\ (Yes, add to PATH)
  • Install 64-bit MSI to C:\Python27_64\
  • Install Pywin32 and Pypiwin32 (32 and 64)

Install PyInstaller

  • C:\Python27_32\python.exe setup.py install

Install Git

You need to have Git installed for GitLab runner to fetch the code.

When installing, select Use git commands in git bash and cmd.