Skip to content

Commit 0babdc9

Browse files
committed
Merge branch 'release/2.2.1'
2 parents 4b85921 + 0ff7cbb commit 0babdc9

File tree

16 files changed

+44
-38
lines changed

16 files changed

+44
-38
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
88

9+
## [2.2.1] - 2019-03-19
10+
- Bugfix: Add tags to spot instances #39
11+
- Changed: Updated terraform providers in examples and default terraform version
12+
913
## [2.2.0] - 2019-03-08
1014
- Changed: Upgrade default runner agent to 11.8.0 and docker machine to 0.16.1
1115
- Bugfix: Correct example for docker_machine_options #36 (@declension)
@@ -94,7 +98,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
9498
- Update default AMI's to The latest Amazon Linux AMI 2017.09.1 - released on 2018-01-17.
9599
- Minor updates in the example
96100

97-
[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.2.0...HEAD
101+
[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.2.1...HEAD
102+
[2.2.1]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.2.0...2.2.1
98103
[2.2.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.1.0...2.2.0
99104
[2.1.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.0.0...2.1.0
100105
[2.0.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/1.8.0...2.0.0

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Build Status](https://travis-ci.com/npalm/terraform-aws-gitlab-runner.svg?branch=master)](https://travis-ci.com/npalm/terraform-aws-gitlab-runner)
2+
[![Gitter](https://badges.gitter.im/terraform-aws-gitlab-runner/Lobby.svg)](https://gitter.im/terraform-aws-gitlab-runner/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
23

34
# Terraform module for GitLab auto scaling runners on Spot instances
45

@@ -157,7 +158,7 @@ module "gitlab-runner" {
157158
| ssh_public_key | Public SSH key used for the gitlab-runner ec2 instance. | string | - | yes |
158159
| subnet_id_runners | Subnet used to hosts the docker-machine runners. | string | - | yes |
159160
| subnet_ids_gitlab_runner | Subnet used for hosting the gitlab-runner. | list | - | yes |
160-
| tags | Map of tags that will be added to created resources. By default resources will be taggen with name and environemnt. | map | `<map>` | no |
161+
| tags | Map of tags that will be added to created resources. By default resources will be tagged with name and environnemnt. | map | `<map>` | no |
161162
| userdata_post_install | User-data script snippet to insert after gitlab-runner install | string | `` | no |
162163
| userdata_pre_install | User-data script snippet to insert before gitlab-runner install | string | `` | no |
163164
| vpc_id | The VPC that is used for the instances. | string | - | yes |

ci/bin/run-local.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

3-
docker run --entrypoint="/bin/sh" -it --rm -w /build -v $(pwd):/build hashicorp/terraform:0.11.7 ./ci/bin/verify.sh
4-
docker run --entrypoint="/bin/sh" -it --rm -w /build -v $(pwd):/build hashicorp/terraform:0.11.7 ./ci/bin/verify-examples.sh
3+
docker run --entrypoint="/bin/sh" -it --rm -w /build -v $(pwd):/build hashicorp/terraform:0.11.13 ./ci/bin/verify.sh
4+
docker run --entrypoint="/bin/sh" -it --rm -w /build -v $(pwd):/build hashicorp/terraform:0.11.13 ./ci/bin/verify-examples.sh

ci/bin/terraform.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
TARGET_DIR=/opt
44
PATH=${PATH}:${TARGET_DIR}
55

6-
TERRAFORM_VERSION=${1:-"0.11.7"}
6+
TERRAFORM_VERSION=${1:-"0.11.13"}
77
OS=${2:-"linux"}
88
TERRAFORM_URL="https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${OS}_amd64.zip"
99

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.7
1+
0.11.13

examples/runner-default/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "vpc" {
22
source = "terraform-aws-modules/vpc/aws"
3-
version = "1.37.0"
3+
version = "1.59.0"
44

55
name = "vpc-${var.environment}"
66
cidr = "10.0.0.0/16"

examples/runner-default/providers.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
provider "aws" {
22
region = "${var.aws_region}"
3-
version = "1.23"
3+
version = "2.2"
44
}
55

66
provider "template" {
7-
version = "1.0"
7+
version = "2.1"
88
}
99

1010
provider "local" {
1111
version = "1.1"
1212
}
1313

1414
provider "null" {
15-
version = "1.0"
15+
version = "2.1"
1616
}
1717

1818
provider "tls" {
19-
version = "1.1"
19+
version = "1.2"
2020
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.7
1+
0.11.13

examples/runner-docker/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "vpc" {
22
source = "terraform-aws-modules/vpc/aws"
3-
version = "1.37.0"
3+
version = "1.59.0"
44

55
name = "vpc-${var.environment}"
66
cidr = "10.1.0.0/16"

examples/runner-docker/providers.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
provider "aws" {
22
region = "${var.aws_region}"
3-
version = "1.23"
3+
version = "2.2"
44
}
55

66
provider "template" {
7-
version = "1.0"
7+
version = "2.1"
88
}
99

1010
provider "local" {
1111
version = "1.1"
1212
}
1313

1414
provider "null" {
15-
version = "1.0"
15+
version = "2.1"
1616
}
1717

1818
provider "tls" {
19-
version = "1.1"
19+
version = "1.2"
2020
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.7
1+
0.11.13

examples/runner-public/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "vpc" {
22
source = "terraform-aws-modules/vpc/aws"
3-
version = "1.37.0"
3+
version = "1.59.0"
44

55
name = "vpc-${var.environment}"
66
cidr = "10.1.0.0/16"

examples/runner-public/providers.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
provider "aws" {
22
region = "${var.aws_region}"
3-
version = "1.23"
3+
version = "2.2"
44
}
55

66
provider "template" {
7-
version = "1.0"
7+
version = "2.1"
88
}
99

1010
provider "local" {
1111
version = "1.1"
1212
}
1313

1414
provider "null" {
15-
version = "1.0"
15+
version = "2.1"
1616
}
1717

1818
provider "tls" {
19-
version = "1.1"
19+
version = "1.2"
2020
}

main.tf

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,19 @@ data "template_file" "runners" {
101101
template = "${file("${path.module}/template/runner-config.tpl")}"
102102

103103
vars {
104-
aws_region = "${var.aws_region}"
105-
gitlab_url = "${var.runners_gitlab_url}"
106-
environment = "${var.environment}"
107-
108-
runners_vpc_id = "${var.vpc_id}"
109-
runners_subnet_id = "${var.subnet_id_runners}"
110-
runners_aws_zone = "${var.aws_zone}"
111-
runners_instance_type = "${var.docker_machine_instance_type}"
112-
runners_spot_price_bid = "${var.docker_machine_spot_price_bid}"
113-
runners_security_group_name = "${aws_security_group.docker_machine.name}"
114-
runners_monitoring = "${var.runners_monitoring}"
115-
116-
docker_machine_options = "${length(var.docker_machine_options) == 0 ? "" : local.docker_machine_options_string}"
117-
104+
aws_region = "${var.aws_region}"
105+
gitlab_url = "${var.runners_gitlab_url}"
106+
107+
runners_vpc_id = "${var.vpc_id}"
108+
runners_subnet_id = "${var.subnet_id_runners}"
109+
runners_aws_zone = "${var.aws_zone}"
110+
runners_instance_type = "${var.docker_machine_instance_type}"
111+
runners_spot_price_bid = "${var.docker_machine_spot_price_bid}"
112+
runners_security_group_name = "${aws_security_group.docker_machine.name}"
113+
runners_monitoring = "${var.runners_monitoring}"
114+
docker_machine_options = "${length(var.docker_machine_options) == 0 ? "" : local.docker_machine_options_string}"
118115
runners_name = "${var.runners_name}"
116+
runners_tags = "${local.tags_string}"
119117
runners_token = "${var.runners_token}"
120118
runners_executor = "${var.runners_executor}"
121119
runners_limit = "${var.runners_limit}"

tags.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ locals {
22
tags = "${merge(map("Name", format("%s", var.environment)),
33
map("Environment", format("%s", var.environment)),
44
var.tags)}"
5+
6+
tags_string = "${replace(replace(jsonencode(local.tags), "/[\\{\\}\"\\s]/", ""), ":", ",")}"
57
}
68

79
data "null_data_source" "tags" {

template/runner-config.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ check_interval = 0
4242
"amazonec2-request-spot-instance=true",
4343
"amazonec2-spot-price=${runners_spot_price_bid}",
4444
"amazonec2-security-group=${runners_security_group_name}",
45-
"amazonec2-tags=environment,${environment}",
45+
"amazonec2-tags=${runners_tags}",
4646
"amazonec2-monitoring=${runners_monitoring}",
4747
"amazonec2-root-size=${runners_root_size}"
4848
${docker_machine_options}

0 commit comments

Comments
 (0)