github.com/ssube/gitlab-ci-multi-runner@v1.2.1-0.20160607142738-b8d1285632e6/docs/development/README.md (about) 1 # Development environment 2 3 ## 1. Install dependencies and Go runtime 4 5 ### For Debian/Ubuntu 6 ```bash 7 apt-get install -y mercurial git-core wget make 8 wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz 9 sudo tar -C /usr/local -xzf go*-*.tar.gz 10 ``` 11 12 ### For OSX using binary package 13 ```bash 14 wget https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.8.tar.gz 15 sudo tar -C /usr/local -xzf go*-*.tar.gz 16 ``` 17 18 ### For OSX if you have brew.sh 19 ``` 20 brew install go 21 ``` 22 23 ### For OSX using installation package 24 ``` 25 wget https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.8.pkg 26 open go*-*.pkg 27 ``` 28 29 ### For FreeBSD 30 ``` 31 pkg install go-1.4.2 gmake git mercurial 32 ``` 33 34 ## 2. Install Docker Engine 35 36 The Docker Engine is required to create pre-built image that is embedded into runner and loaded when using docker executor. 37 38 [Install Docker Engine](https://docs.docker.com/engine/installation/) 39 40 ## 3. Configure Go 41 42 Add to `.profile` or `.bash_profile`: 43 44 ```bash 45 export GOPATH=$HOME/Go 46 export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin 47 ``` 48 49 Create new terminal session and create $GOPATH directory: 50 51 ``` 52 mkdir -p $GOPATH 53 ``` 54 55 ## 4. Download runner sources 56 57 ``` 58 go get gitlab.com/gitlab-org/gitlab-ci-multi-runner 59 cd $GOPATH/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/ 60 ``` 61 62 ## 5. Install runner dependencies 63 64 This will download and restore all dependencies required to build runner: 65 ``` 66 make deps 67 ``` 68 69 **For FreeBSD use `gmake deps`** 70 71 ## 6. Run runner 72 73 Normally you would use `gitlab-runner`, in order to compile and run Go source use go toolchain: 74 75 ``` 76 make install 77 gitlab-ci-multi-runner run 78 ``` 79 80 You can run runner in debug-mode: 81 82 ``` 83 make install 84 gitlab-ci-multi-runner --debug run 85 ``` 86 87 ## 7. Compile and install runner binary as `gitlab-ci-multi-runner` 88 89 ``` 90 make install 91 ``` 92 93 ## 8. Congratulations! 94 95 You can start hacking GitLab-Runner code. If you are interested you can use Intellij IDEA Community Edition with [go-lang-idea-plugin](https://github.com/go-lang-plugin-org/go-lang-idea-plugin) to edit and debug code. 96 97 ## Troubleshooting 98 99 ### executor_docker.go missing Asset symbol 100 101 This error happens due to missing executors/docker/bindata.go file that is generated from docker prebuilts. 102 Which is especially tricky on Windows. 103 104 Try to execute: `make deps docker`, if it doesn't help you can do that in steps: 105 1. Execute `go get -u github.com/jteeuwen/go-bindata/...` 106 2. Download https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/master/docker/prebuilt.tar.gz and save to out/docker/prebuilt.tar.gz 107 3. Execute `make docker` or check the Makefile how this command looks like