Skip to content

Instantly share code, notes, and snippets.

@ciberado
Created June 25, 2023 13:54
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 ciberado/1a256c950bf755c42ceb55b83aa01e29 to your computer and use it in GitHub Desktop.
Save ciberado/1a256c950bf755c42ceb55b83aa01e29 to your computer and use it in GitHub Desktop.

GitLab CICD playful runner instructions

Project creation

  • Create an account at https://gitlab.com

  • Create a new empty project

  • Add a file named .gitlab-ci.yml

  • This complex pipeline to check the system:

test:
    script: echo "Holi!"
  • Control your frustration

Runner configuration

  • Go to settings -> CI/CD

  • Expand the Runners tab

  • Disable Enable shared runners for this project

  • Click on New project runner

  • Select Linux

  • Add dind as the tag

  • Check Run untagged jobs (very important)

  • Press Create runner

  • Copy the token to the clipboard

  • Go to https://labs.play-with-docker.com and sign in

  • Create a new instance

  • Type this to define a volume

docker volume create gitlab-runner-config
  • Run the CI/CD agent
docker run -d --name gitlab-runner \
  --restart always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v gitlab-runner-config:/etc/gitlab-runner \
  gitlab/gitlab-runner:latest
  • Start the configuration process
docker run --rm -it \
  -v gitlab-runner-config:/etc/gitlab-runner \
  gitlab/gitlab-runner:latest register
  • Type https://gitlab.com as the GitLab instance

  • Paste the token from the clipboard

Testing the pipeline

  • Run again the pipeline

  • Big success!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment