From a2dda1661c77b05349cf607788593752abfe9fcc Mon Sep 17 00:00:00 2001 From: Kevin Rambaud Date: Thu, 25 Jul 2019 14:09:40 -0400 Subject: [PATCH 1/4] Add runners_volumes variable (#105) * Add runners_volumes variable * Update tf documentation --- README.md | 1 + _docs/TF_MODULE.md | 1 + main.tf | 1 + template/runner-config.tpl | 2 +- variables.tf | 6 ++++++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f3292bb4..2a3c6b730 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,7 @@ terraform destroy | runners\_shm\_size | shm_size for the runners. will be used in the runner config.toml | string | `"0"` | no | | runners\_token | Token for the runner, will be used in the runner config.toml. | string | `"__REPLACED_BY_USER_DATA__"` | no | | runners\_use\_private\_address | Restrict runners to the use of a private IP address | string | `"true"` | no | +| runners\_volumes | Specify additional volumes that should be mounted (same syntax as Docker’s -v flag) | list | `` | no | | secure\_parameter\_store\_runner\_token\_key | The key name used store the Gitlab runner token in Secure Parameter Store | string | `"runner-token"` | no | | ssh\_public\_key | Public SSH key used for the GitLab runner EC2 instance. | string | n/a | yes | | subnet\_id\_runners | List of subnets used for hosting the gitlab-runners. | string | n/a | yes | diff --git a/_docs/TF_MODULE.md b/_docs/TF_MODULE.md index 1afc96291..ec273a4c2 100644 --- a/_docs/TF_MODULE.md +++ b/_docs/TF_MODULE.md @@ -60,6 +60,7 @@ | runners\_shm\_size | shm_size for the runners. will be used in the runner config.toml | string | `"0"` | no | | runners\_token | Token for the runner, will be used in the runner config.toml. | string | `"__REPLACED_BY_USER_DATA__"` | no | | runners\_use\_private\_address | Restrict runners to the use of a private IP address | string | `"true"` | no | +| runners\_volumes | Specify additional volumes that should be mounted (same syntax as Docker’s -v flag) | list | `` | no | | secure\_parameter\_store\_runner\_token\_key | The key name used store the Gitlab runner token in Secure Parameter Store | string | `"runner-token"` | no | | ssh\_public\_key | Public SSH key used for the GitLab runner EC2 instance. | string | n/a | yes | | subnet\_id\_runners | List of subnets used for hosting the gitlab-runners. | string | n/a | yes | diff --git a/main.tf b/main.tf index 5551d5dbf..b3d496008 100644 --- a/main.tf +++ b/main.tf @@ -161,6 +161,7 @@ data "template_file" "runners" { runners_concurrent = "${var.runners_concurrent}" runners_image = "${var.runners_image}" runners_privileged = "${var.runners_privileged}" + runners_volumes = "${length(var.runners_volumes) == 0 ? "[]" : format("[\"%s\"]", join("\", \"", var.runners_volumes))}" runners_shm_size = "${var.runners_shm_size}" runners_pull_policy = "${var.runners_pull_policy}" runners_idle_count = "${var.runners_idle_count}" diff --git a/template/runner-config.tpl b/template/runner-config.tpl index 19acb4941..32e28fcea 100644 --- a/template/runner-config.tpl +++ b/template/runner-config.tpl @@ -18,7 +18,7 @@ check_interval = 0 image = "${runners_image}" privileged = ${runners_privileged} disable_cache = false - volumes = ["/cache"] + volumes = ${runners_volumes} shm_size = ${runners_shm_size} pull_policy = "${runners_pull_policy}" [runners.cache] diff --git a/variables.tf b/variables.tf index 7c618deb2..ca2806146 100644 --- a/variables.tf +++ b/variables.tf @@ -115,6 +115,12 @@ variable "runners_privileged" { default = "true" } +variable "runners_volumes" { + description = "Specify additional volumes that should be mounted (same syntax as Docker’s -v flag)" + type = "list" + default = ["/cache"] +} + variable "runners_shm_size" { description = "shm_size for the runners. will be used in the runner config.toml" default = 0 From b867c6e014a5f0adcac3609d9b3f058a16cc3d0a Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Thu, 25 Jul 2019 20:23:59 +0200 Subject: [PATCH 2/4] Update default runner version to 12.1.0 (#106) --- README.md | 2 +- _docs/TF_MODULE.md | 2 +- variables.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a3c6b730..275051da0 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ terraform destroy | environment | A name that identifies the environment, used as prefix and for tagging. | string | n/a | yes | | gitlab\_runner\_registration\_config | Configuration used to register the runner. See the README for an example, or reference the examples in the examples directory of this repo. | map | `` | no | | gitlab\_runner\_ssh\_cidr\_blocks | List of CIDR blocks to allow SSH Access to the gitlab runner instance. | list | `` | no | -| gitlab\_runner\_version | Version of the GitLab runner. | string | `"11.11.2"` | no | +| gitlab\_runner\_version | Version of the GitLab runner. | string | `"12.1.0"` | no | | instance\_role\_json | Default runner instance override policy, expected to be in JSON format. | string | `""` | no | | instance\_type | Instance type used for the GitLab runner. | string | `"t3.micro"` | no | | name\_runners\_docker\_machine | | string | `""` | no | diff --git a/_docs/TF_MODULE.md b/_docs/TF_MODULE.md index ec273a4c2..4092c507d 100644 --- a/_docs/TF_MODULE.md +++ b/_docs/TF_MODULE.md @@ -26,7 +26,7 @@ | environment | A name that identifies the environment, used as prefix and for tagging. | string | n/a | yes | | gitlab\_runner\_registration\_config | Configuration used to register the runner. See the README for an example, or reference the examples in the examples directory of this repo. | map | `` | no | | gitlab\_runner\_ssh\_cidr\_blocks | List of CIDR blocks to allow SSH Access to the gitlab runner instance. | list | `` | no | -| gitlab\_runner\_version | Version of the GitLab runner. | string | `"11.11.2"` | no | +| gitlab\_runner\_version | Version of the GitLab runner. | string | `"12.1.0"` | no | | instance\_role\_json | Default runner instance override policy, expected to be in JSON format. | string | `""` | no | | instance\_type | Instance type used for the GitLab runner. | string | `"t3.micro"` | no | | name\_runners\_docker\_machine | | string | `""` | no | diff --git a/variables.tf b/variables.tf index ca2806146..b8917c7f0 100644 --- a/variables.tf +++ b/variables.tf @@ -257,7 +257,7 @@ variable "cache_shared" { variable "gitlab_runner_version" { description = "Version of the GitLab runner." type = "string" - default = "11.11.2" + default = "12.1.0" } variable "enable_gitlab_runner_ssh_access" { From 9ecf10ddfa05f791c63f01b5e8925e8316694cce Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Fri, 26 Jul 2019 20:17:12 +0200 Subject: [PATCH 3/4] update --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 991042ed1..268150e4c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,4 +8,4 @@ YES | NO - If yes please describe the mirgration. Please mentioned the examples you have verified. ## Documentation -Please ensure you pdate the README in `_docs/README.md`. The README.md in the root can be update by running the script `ci/bin/autodocs.sh` +Please ensure you update the README in `_docs/README.md`. The README.md in the root can be update by running the script `ci/bin/autodocs.sh` From fc4dcae7433c729055ed26c06b2926d4f1455f4b Mon Sep 17 00:00:00 2001 From: Niek Palm Date: Fri, 26 Jul 2019 22:31:03 +0200 Subject: [PATCH 4/4] Release 3.9.0 --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 390b6b778..e026f167a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 3.9.0 - 2019-07-26 +- Changed + - Update default runner version to 12.1.0 (#106) +- Added + - Add runners_volumes variable (#105) @kevinrambaud + ## 3.8.0 - 2019-07-22 - Added - Variable `docker_machine_ssh_cidr_blocks` to set CIDR for ingress on docker machine SSH rules. @kevinrambaud #101 @@ -148,7 +154,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Update default AMI's to The latest Amazon Linux AMI 2017.09.1 - released on 2018-01-17. - Minor updates in the example -[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.8.0...HEAD +[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.9.0...HEAD +[3.9.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.8.0...3.9.0 [3.8.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.7.0...3.8.0 [3.7.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.6.0...3.7.0 [3.6.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/3.5.0...3.6.0