Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Latest commit

 

History

History
107 lines (75 loc) · 2.55 KB

File metadata and controls

107 lines (75 loc) · 2.55 KB

Development environment

1. Install dependencies and Go runtime

For Debian/Ubuntu

apt-get install -y mercurial git-core wget make
wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go*-*.tar.gz

For OSX using binary package

wget https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.8.tar.gz
sudo tar -C /usr/local -xzf go*-*.tar.gz

For OSX if you have brew.sh

brew install go

For OSX using installation package

wget https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.8.pkg
open go*-*.pkg

For FreeBSD

pkg install go-1.4.2 gmake git mercurial

2. Install Docker Engine

The Docker Engine is required to create pre-built image that is embedded into runner and loaded when using docker executor.

Install Docker Engine

3. Configure Go

Add to .profile or .bash_profile:

export GOPATH=$HOME/Go
export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin

Create new terminal session and create $GOPATH directory:

mkdir -p $GOPATH

4. Download runner sources

go get gitlab.com/gitlab-org/gitlab-ci-multi-runner
cd $GOPATH/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/

5. Install runner dependencies

This will download and restore all dependencies required to build runner:

make deps

For FreeBSD use gmake deps

6. Run runner

Normally you would use gitlab-runner, in order to compile and run Go source use go toolchain:

make install
gitlab-ci-multi-runner run

You can run runner in debug-mode:

make install
gitlab-ci-multi-runner --debug run

7. Compile and install runner binary as gitlab-ci-multi-runner

make install

8. Congratulations!

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.

Troubleshooting

executor_docker.go missing Asset symbol

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:

  1. Execute go get -u github.com/jteeuwen/go-bindata/...
  2. Download https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/master/docker/prebuilt.tar.gz and save to out/docker/prebuilt.tar.gz
  3. Execute make docker or check the Makefile how this command looks like