Created
August 26, 2019 18:25
-
-
Save clairtonluz/a2d785f998e10025029e7c8b1f65cdfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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