Commit 495e65c5 authored by Kamil Trzciński's avatar Kamil Trzciński 🔴

Info about example GitLab CI integration

parent c7046fdd
v 0.1.4
- Remove Job and merge it into Build
- Introduce simple API server
- Ask for services during setup
v 0.1.3
- Optimize setup
- Optimize multi-runner setup - making it more concurrent
......
......@@ -46,9 +46,15 @@ This project was made as Go learning opportunity. The initial release was create
sudo chmod +x /usr/local/bin/gitlab-ci-multi-runner
```
1. If you want to use Docker - install Docker:
```bash
curl -sSL https://get.docker.com/ | sh
```
1. Create a GitLab CI user (Linux)
```
sudo adduser --disabled-login --gecos 'GitLab Runner' gitlab_ci_runner
sudo usermod -aG docker gitlab_ci_runner
sudo su gitlab_ci_runner
cd ~/
```
......@@ -70,8 +76,7 @@ This project was made as Go learning opportunity. The initial release was create
INFO[0037] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
```
* Definition of hostname will be available with version 7.8.0 of GitLab CI.
* Ability to specify tag list will be available once this get merged: https://gitlab.com/gitlab-org/gitlab-ci/merge_requests/32
* Definition of hostname will be available with version 7.8.0 of GitLab CI.
1. Run the runner
```bash
......@@ -179,6 +184,88 @@ Configuration uses TOML format described here: https://github.com/toml-lang/toml
1. Example configuration file
[Example configuration file](config.toml.example)
## Example integrations
### How to configure runner for GitLab CI integration tests?
1. Run setup
```bash
$ gitlab-ci-multi-runner-linux setup
Please enter the gitlab-ci coordinator URL (e.g. http://gitlab-ci.org:3000/ )
https://ci.gitlab.com/
Please enter the gitlab-ci token for this runner
REGISTRATION_TOKEN
Please enter the gitlab-ci description for this runner
my-gitlab-ci-runner
INFO[0047] 5bf4aa89 Registering runner... succeeded
Please enter the executor: shell, docker, docker-ssh, ssh?
docker
Please enter the Docker image (eg. ruby:2.1):
ruby:2.1
If you want to enable mysql please enter version (X.Y) or enter latest?
latest
If you want to enable postgres please enter version (X.Y) or enter latest?
latest
If you want to enable redis please enter version (X.Y) or enter latest?
latest
If you want to enable mongodb please enter version (X.Y) or enter latest?
INFO[0069] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
```
1. Run the multi-runner if you didn't already
```bash
$ gitlab-ci-multi-runner-linux run
```
1. Add job to test with MySQL
```bash
wget -q http://ftp.de.debian.org/debian/pool/main/p/phantomjs/phantomjs_1.9.0-1+b1_amd64.deb
dpkg -i phantomjs_1.9.0-1+b1_amd64.deb
bundle install --deployment --path /cache
cp config/application.yml.example config/application.yml
cp config/database.yml.mysql config/database.yml
sed -i 's/username:.*/username: root/g' config/database.yml
sed -i 's/password:.*/password:/g' config/database.yml
sed -i 's/# socket:.*/host: mysql/g' config/database.yml
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
bundle exec rake db:create
bundle exec rake db:setup
bundle exec rake spec
```
1. Add job to test with PostgreSQL
```bash
wget -q http://ftp.de.debian.org/debian/pool/main/p/phantomjs/phantomjs_1.9.0-1+b1_amd64.deb
dpkg -i phantomjs_1.9.0-1+b1_amd64.deb
bundle install --deployment --path /cache
cp config/application.yml.example config/application.yml
cp config/database.yml.postgresql config/database.yml
sed -i 's/username:.*/username: postgres/g' config/database.yml
sed -i 's/password:.*/password:/g' config/database.yml
sed -i 's/# socket:.*/host: postgres/g' config/database.yml
cp config/resque.yml.example config/resque.yml
sed -i 's/localhost/redis/g' config/resque.yml
bundle exec rake db:create
bundle exec rake db:setup
bundle exec rake spec
```
1. Voila! You now have GitLab CI integration testing instance with bundle caching. Push some commits to test it.
1. Look into `config.toml` and tune it.
### FAQ
TBD
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment