apt-get install -y mercurial git-core wget make
wget https://storage.googleapis.com/golang/go1.8.7.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go*-*.tar.gzwget https://storage.googleapis.com/golang/go1.8.7.darwin-amd64.tar.gz
sudo tar -C /usr/local -xzf go*-*.tar.gzbrew install go
wget https://storage.googleapis.com/golang/go1.8.7.darwin-amd64.pkg
open go*-*.pkg
pkg install go-1.8.7 gmake git mercurial
The Docker Engine is required to create pre-built image that is embedded into runner and loaded when using docker executor.
Make sure that on machine that is running your Docker Engine you have a binfmt_misc.
This is required to be able to build ARM images that are embedded into GitLab Runner binary.
-
For Debian/Ubuntu it's sufficient to execute:
apt-get install binfmt-support qemu-user-static -
For Docker for MacOS/Windows
binfmt_miscis enabled by default. -
For CoreOS (but also works on Debian and Ubuntu) you need to execute the following script on system start:
#!/bin/sh set -xe /sbin/modprobe binfmt_misc mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc # Support for ARM binaries through Qemu: { echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register; } 2>/dev/null { echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-static:' > /proc/sys/fs/binfmt_misc/register; } 2>/dev/null
Add to .profile or .bash_profile:
export GOPATH=$HOME/Go
export PATH=$PATH:$GOPATH/bin:/usr/local/go/binCreate new terminal session and create $GOPATH directory:
mkdir -p $GOPATH
go get gitlab.com/gitlab-org/gitlab-runner
cd $GOPATH/src/gitlab.com/gitlab-org/gitlab-runner/
This will download and restore all dependencies required to build runner:
make deps
For FreeBSD use gmake deps
Normally you would use gitlab-runner, in order to compile and run Go source use go toolchain:
make install
gitlab-runner run
You can run runner in debug-mode:
make install
gitlab-runner --debug run
make install
GitLab Runner test suite consists of "core" tests and tests for executors. Tests for executors require certain binaries to be installed on your local machine. Some of these binaries cannot be installed on all operating systems. If a binary is not installed tests requiring this binary will be skipped.
These are the binaries that you can install:
- VirtualBox and Vagrant
- kubectl with Minikube
- Parallels
- PowerShell
After installing the binaries run:
make development_setup
To execute the tests run:
make test
You can start hacking GitLab-Runner code. If you are interested you can use Intellij IDEA Community Edition with go-lang-idea-plugin to edit and debug code.
GitLab Runner uses dep to manage
its dependencies - they get checked into the repository under the vendor/ directory,
with a manifest stored in Godep.toml and in Godep.lock lockfile.
If your contribution adds, removes or updates any dependencies to the runner,
please ensure the vendored copies is updated with the appropriate dep ensure command.
Don't add dependency from upstream master branch when version tags are available.
This error happens due to missing executors/docker/bindata.go file that is generated from docker prebuilts. Which is especially tricky on Windows.
Try to execute: make deps docker, if it doesn't help you can do that in steps:
- Execute
go get -u github.com/jteeuwen/go-bindata/... - Download https://gitlab-runner-downloads.s3.amazonaws.com/master/docker/prebuilt-x86_64.tar.xz and save to out/docker/prebuilt-x86_64.tar.xz
- Download https://gitlab-runner-downloads.s3.amazonaws.com/master/docker/prebuilt-arm.tar.xz and save to out/docker/prebuilt-arm.tar.xz
- Execute
make dockeror check the Makefile how this command looks like