0

Given

We run an in-house GitLab server, with many projects (aka "repositories")

We provision all servers using Ansible (and deploy projects using pip)

We deploy to

  • dev.project.example.com
  • test.project.example..com
  • beta.project.example..com
  • (and eventually to) www.project.example..com

When

We add .gitlab-ci-.yml to all projects' repository roots

We want to use dev.project.example.com as a runner for that GitLab project

Then

What Ansible playbooks could we write to provision dev.project.example.com as a GitLab Runner for that project?

1 Answer 1

1

A gitlab runner is a process that f.e. tests, compiles your project, pushes the artefact to you artefact store etc.

A Gitlab runner can be tagged inside Gitlab or via config.toml - so - you can assign runners via tags to Gitlab projects (shared).

Gitlab runner are not designed to run an application 24x7. So - you assign a project to a runner (or a tag or all) to build you application). If you want to deploy the project, use the K8S deployment inside Gitlab (that must be connected to a specific Kubernetes environment based on you Git-branches etc). Or (just an example) run an AWX task that is able to push your new artefact via the artefact storage (docker registry). Also you could just call a SSH remote command on a script (via Gitlab runner) to start a deployment - but don't use the runner to "host" your environment. They will stop (per default after 1h) without a return code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.