gitlab-runner

digio/gitlab-runner/google

Terraform Module HCL GOOGLE

Terraform module for provisioning a GitLab CI Runner in a GCP project using the docker+machine executor.

Install
module "gitlab-runner" {
source = "digio/gitlab-runner/google"
version = "0.0.13"
}
plain text: /constructs/tfmod-digio-gitlab-runner-google/install.txt
⭐ Source on GitHub 📦 Registry page
README

GCP GitLab Runner A Terraform module for configuring a GCP-based GitLab CI Runner. This runner is configured to use the docker+machine executor which allows the infrastructure to be scaled up and down as demand requires. The minimum cost (during zero activity) is the cost of an f1-micro instance. The long-running runner instance runs under a gitlab-ci-runner service account. This account will be granted all required permissions to spawn worker instances on demand. The worker instances run under a gitlab-ci-worker service account. This account will need to be granted any privileges required to perform build and deploy activities. Usage See examples for more detail on how to configure this module.

Inputs (16)
NameTypeDescriptionDefault
gcp_zonestringThe GCP zone to deploy the runner into. required
gitlab_urlstringThe URL of the GitLab server hosting the projects to be built. required
gcp_projectstringThe GCP project to deploy the runner into. required
ci_tokenstringThe runner registration token obtained from GitLab. required
ci_concurrencynumberThe maximum number of worker instances to create.1
ci_worker_disk_sizestringThe size of the persistent disk in GB."10"
ci_worker_instance_typestringThe GCP instance type. This can be adjusted to meet the demands of builds jobs."n1-standard-1"
docker_privilegedstringGive extended privileges to container."false"
ci_worker_idle_timenumberThe maximum idle time for workers before they are shutdown.300
ci_worker_instance_tagsstringThe GCP instance networking tags to apply."gitlab-ci-worker"
ci_runner_gitlab_untaggedstringRegister the runner to also execute GitLab jobs that are untagged."true"
ci_runner_gitlab_tagsstringRegister the runner to execute GitLab jobs with these tags.""
ci_runner_disk_sizestringThe size of the persistent disk in GB."20"
ci_runner_gitlab_namestringRegister the runner in GitLab using this name. If empty the value "gcp-${var.gc""
ci_runner_instance_typestringThe instance type used for the runner. This shouldn't need to be changed because"f1-micro"
gcp_resource_prefixstringThe prefix to apply to all GCP resource names (e.g. <prefix>-runner, <prefix>-wo"gitlab-ci"
Outputs (1)
ci_worker_service_account — The service account created for the worker instances. Privileges/roles may need to be assigned to th
Resources (4)
google_compute_instancegoogle_project_iam_membergoogle_service_accountgoogle_service_account_iam_member
Details
FrameworkTerraform Module
LanguageHCL
Version0.0.13
Cloud GOOGLE
★ Stars39
Forks42
Total downloads7.5k
Inputs16
Outputs1
Resources4
Examples2
LicenseApache-2.0
Namespacedigio
Updated