-
Notifications
You must be signed in to change notification settings - Fork 40
/
variables.tf
145 lines (135 loc) · 4.12 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/**
* Copyright 2021 Mantel Group Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
# Global options
variable "ci_token" {
type = string
description = "The runner registration token obtained from GitLab."
}
variable "gcp_project" {
type = string
description = "The GCP project to deploy the runner into."
}
variable "gcp_zone" {
type = string
description = "The GCP zone to deploy the runner into."
}
variable "gitlab_url" {
type = string
description = "The URL of the GitLab server hosting the projects to be built."
}
variable "gcp_resource_prefix" {
type = string
default = "gitlab-ci"
description = "The prefix to apply to all GCP resource names (e.g. <prefix>-runner, <prefix>-worker-1)."
}
# Runner options
variable "ci_runner_network" {
type = string
default = "default"
description = "the network to add the runner on"
}
variable "ci_runner_subnetwork" {
type = string
default = ""
description = "the subnetwork to add the runner on"
}
variable "ci_runner_disk_size" {
type = string
default = "20"
description = "The size of the persistent disk in GB."
}
variable "ci_runner_gitlab_name" {
type = string
default = ""
description = "Register the runner in GitLab using this name. If empty the value \"gcp-$${var.gcp_project}\" will be used."
}
variable "ci_runner_gitlab_tags" {
type = string
default = ""
description = "Register the runner to execute GitLab jobs with these tags."
}
variable "ci_runner_instance_type" {
type = string
default = "f1-micro"
description = <<EOF
The instance type used for the runner. This shouldn't need to be changed because the builds
themselves run on separate worker instances.
EOF
}
# Worker options
variable "ci_concurrency" {
type = number
default = 1
description = "The maximum number of worker instances to create."
}
variable "ci_worker_disk_size" {
type = string
default = "10"
description = "The size of the persistent disk in GB."
}
variable "ci_worker_idle_time" {
type = number
default = 300
description = "The maximum idle time for workers before they are shutdown."
}
variable "ci_worker_instance_tags" {
type = string
default = "gitlab-ci-worker"
description = "The GCP instance networking tags to apply."
}
variable "ci_worker_instance_type" {
type = string
default = "n1-standard-1"
description = "The GCP instance type. This can be adjusted to meet the demands of builds jobs."
}
variable "docker_privileged" {
type = string
default = "false"
description = "Give extended privileges to container."
}
# Pre/post hook scripts
variable "pre_clone_script" {
type = string
default = ""
description = <<EOF
Commands to be executed on the runner before cloning the Git repository.
NOTE: this script runs within the gitlab-runner helper image.
EOF
}
variable "post_clone_script" {
type = string
default = ""
description = <<EOF
Commands to be executed on the runner after cloning the Git repository.
NOTE: this script runs within the gitlab-runner helper image.
EOF
}
variable "pre_build_script" {
type = string
default = ""
description = <<EOF
Commands to be executed on the runner before executing the build.
NOTE: this script runs within the build image specified by .gitlab-ci.yml.
EOF
}
variable "post_build_script" {
type = string
default = ""
description = <<EOF
Commands to be executed on the runner after executing the build.
NOTE: this script runs within the build image specified by .gitlab-ci.yml.
EOF
}