I have droplet with installed gitlab omnibus server, gitlab-runner and docker. Trying to configure runner to rebuild and run docker container on every push to master branch. Following to gitlab's instruction:
I registered runner:
$ sudo gitlab-runner register
Runtime platform arch=amd64 os=linux pid=8665 revision=3afdaba6 version=11.5.0
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://example.com/
Please enter the gitlab-ci token for this runner:
ru7i9G9R-3BJn2RXKdtv
Please enter the gitlab-ci description for this runner:
[ubuntu-s-1vcpu-1gb-fra1-01]: warehouse
Please enter the gitlab-ci tags for this runner (comma separated):
warehouse
Registering runner... succeeded runner=ru7i9G9R
Please enter the executor: parallels, ssh, virtualbox, docker+machine, kubernetes, docker, docker-ssh, shell, docker-ssh+machine:
docker
Please enter the default Docker image (e.g. ruby:2.1):
warehouse:latest
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
Here is config.toml file generated on runner registering:
$ sudo cat /etc/gitlab-runner/config.toml
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "warehouse"
url = "http://example.com/"
token = "f5b8036463e2f97d2ab4bc721b6a91"
executor = "docker"
[runners.docker]
tls_verify = false
image = "warehouse:latest"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
Runner is alive:
$ sudo gitlab-runner verify
Runtime platform arch=amd64 os=linux pid=9417 revision=3afdaba6 version=11.5.0
Running in system-mode.
Verifying runner... is alive runner=f5b80364
Then I ran it:
$ sudo gitlab-runner run
Runtime platform arch=amd64 os=linux pid=9678 revision=3afdaba6 version=11.5.0
Starting multi-runner from /etc/gitlab-runner/config.toml ... builds=0
Running in system-mode.
Configuration loaded builds=0
Listen address not defined, metrics server disabled builds=0
Listen address not defined, session server disabled builds=0
Gitlab see that runner:
But when I push to master pipeline stucks:
This is .gitlab-ci.yml
file in project I try to pipeline:
build_image:
script:
- docker stop warehouse warehouse_redis
- docker-compose build
- docker-compose up -d
If I build this on server manually everything works well.
So on pushing runner just stucks without any information about issue. Did I miss anything? Help me please. I want to run ci/cd pipelines on same with gitlab server droplet. But want to edit sources on local PC using IDE.
Looks like your gitlab-runner is not configured to run untagged jobs. The runner is registered with the warehouse
tag.
You can configure the gitlab pipeline to use the warehouse
tag (https://docs.gitlab.com/ee/ci/yaml/README.html#tags):
build_image:
script:
- docker stop warehouse warehouse_redis
- docker-compose build
- docker-compose up -d
tags:
- warehouse
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With