From 76b71d264d0c360a9061289ba3362d3b1aa96e47 Mon Sep 17 00:00:00 2001 From: sevillaarvin <33614172+sevillaarvin@users.noreply.github.com> Date: Sat, 18 May 2019 10:53:26 +0800 Subject: [PATCH] Add gitlab-runner documentation (#2131) --- DOCUMENTATION/content/documentation/index.md | 61 ++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index c93d173..0704aba 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -862,6 +862,67 @@ docker-compose up -d gitlab +
+ +## Use Gitlab Runner + +1 - Retrieve the registration token in your gitlab project (Settings > CI / CD > Runners > Set up a specific Runner manually) + +2 - Open the `.env` file and set the following changes: +``` +# so that gitlab container will pass the correct domain to gitlab-runner container +GITLAB_DOMAIN_NAME=http://gitlab + +GITLAB_RUNNER_REGISTRATION_TOKEN= + +# so that gitlab-runner container will send POST request for registration to correct domain +GITLAB_CI_SERVER_URL=http://gitlab +``` + +3 - Open the `docker-compose.yml` file and add the following changes: +```yml + gitlab-runner: + environment: # these values will be used during `gitlab-runner register` + - RUNNER_EXECUTOR=docker # change from shell (default) + - DOCKER_IMAGE=alpine + - DOCKER_NETWORK_MODE=laradock_backend + networks: + - backend # connect to network where gitlab service is connected +``` + +4 - Run the Gitlab-Runner Container (`gitlab-runner`) with the `docker-compose up` command. Example: + +```bash +docker-compose up -d gitlab-runner +``` + +5 - Register the gitlab-runner to the gitlab container + +```bash +docker-compose exec gitlab-runner bash +gitlab-runner register +``` + +6 - Create a `.gitlab-ci.yml` file for your pipeline + +```yml +before_script: + - echo Hello! + +job1: + scripts: + - echo job1 +``` + +7 - Push changes to gitlab + +8 - Verify that pipeline is run successful + + + + + +
## Use Adminer