Skip to content

Instantly share code, notes, and snippets.

@clairtonluz
Created August 26, 2019 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clairtonluz/a2d785f998e10025029e7c8b1f65cdfb to your computer and use it in GitHub Desktop.
Save clairtonluz/a2d785f998e10025029e7c8b1f65cdfb to your computer and use it in GitHub Desktop.
# cria o runner no docker
docker run -d \
--name gitlab-runner \
--restart always \
-v gitlab-runner:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
# Entra no runner criado anteriormente
docker exec -it gitlab-runner bash
# Cria as variaveis de ambiente com os valores do seu gitlab
# Você encontra esses valores no seu projeto em Settings > CI/CD > Runners
export GITLAB_URL=https://gitlab.example.com/
export GITLAB_TOKEN=J9y88dDZs_ADakscfPUf
# Registra o runner no seu gitlab
gitlab-runner \
register -n \
--name "Docker Runner" \
--executor docker \
--docker-image docker:latest \
--docker-volumes /var/run/docker.sock:/var/run/docker.sock \
--url $GITLAB_URL \
--registration-token $GITLAB_TOKEN \
--tag-list test,linux,some-tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment