File tree 6 files changed +173
-125
lines changed
6 files changed +173
-125
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ This examples shows:
8
8
- Registration via GitLab token.
9
9
- Auto scaling using ` docker+machine ` executor.
10
10
- Addtional security groups that are allowed access to the runner agent
11
+ - A multiline pre build script
12
+ - A single line post build script
11
13
12
14
![ runners-default] ( https://github.com/npalm/assets/raw/master/images/terraform-aws-gitlab-runner/runner-default.png )
13
15
Original file line number Diff line number Diff line change @@ -92,6 +92,15 @@ module "runner" {
92
92
timezone = var.timezone
93
93
}
94
94
]
95
+
96
+ runners_pre_build_script = << EOT
97
+ '''
98
+ echo 'multiline 1'
99
+ echo 'multiline 2'
100
+ '''
101
+ EOT
102
+
103
+ runners_post_build_script = " \" echo 'single line'\" "
95
104
}
96
105
97
106
resource "null_resource" "cancel_spot_requests" {
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ resource "null_resource" "remove_runner" {
38
38
}
39
39
40
40
locals {
41
- enable_asg_recreation = var. enable_forced_updates != null ? ! var. enable_forced_updates : var. enable_asg_recreation
41
+ enable_asg_recreation = var. enable_forced_updates != null ? ! var. enable_forced_updates : var. enable_asg_recreation
42
42
43
43
template_user_data = templatefile (" ${ path . module } /template/user-data.tpl" ,
44
44
{
@@ -123,7 +123,7 @@ locals {
123
123
runners_root_size = var.runners_root_size
124
124
runners_iam_instance_profile_name = var.runners_iam_instance_profile_name
125
125
runners_use_private_address_only = var.runners_use_private_address
126
- runners_use_private_address = ! var.runners_use_private_address
126
+ runners_use_private_address = ! var.runners_use_private_address
127
127
runners_request_spot_instance = var.runners_request_spot_instance
128
128
runners_environment_vars = jsonencode (var. runners_environment_vars )
129
129
runners_pre_build_script = var.runners_pre_build_script
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ check_interval = 0
7
7
token = "${ runners_token} "
8
8
executor = "${ runners_executor} "
9
9
environment = ${ runners_environment_vars}
10
- pre_build_script = " ${ runners_pre_build_script} "
11
- post_build_script = " ${ runners_post_build_script} "
12
- pre_clone_script = " ${ runners_pre_clone_script} "
10
+ pre_build_script = ${ runners_pre_build_script}
11
+ post_build_script = ${ runners_post_build_script}
12
+ pre_clone_script = ${ runners_pre_clone_script}
13
13
request_concurrency = ${ runners_request_concurrency}
14
14
output_limit = ${ runners_output_limit}
15
15
limit = ${ runners_limit}
Original file line number Diff line number Diff line change @@ -257,19 +257,19 @@ variable "runners_environment_vars" {
257
257
variable "runners_pre_build_script" {
258
258
description = " Script to execute in the pipeline just before the build, will be used in the runner config.toml"
259
259
type = string
260
- default = " "
260
+ default = " \"\" "
261
261
}
262
262
263
263
variable "runners_post_build_script" {
264
264
description = " Commands to be executed on the Runner just after executing the build, but before executing after_script. "
265
265
type = string
266
- default = " "
266
+ default = " \"\" "
267
267
}
268
268
269
269
variable "runners_pre_clone_script" {
270
270
description = " Commands to be executed on the Runner before cloning the Git repository. this can be used to adjust the Git client configuration first, for example. "
271
271
type = string
272
- default = " "
272
+ default = " \"\" "
273
273
}
274
274
275
275
variable "runners_request_concurrency" {
You can’t perform that action at this time.
0 commit comments