Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Mar 8, 2019
2 parents 56cf1ae + 9696d27 commit 4b85921
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [2.2.0] - 2019-03-08
- Changed: Upgrade default runner agent to 11.8.0 and docker machine to 0.16.1
- Bugfix: Correct example for docker_machine_options #36 (@declension)
- Added: AWS Zone variable #35 (@declension)

## [2.1.0] - 2019-02-28
- Bugfix: Shared cache is not working #33
- Bugfix: Missing documentation makes setup fail #31
Expand Down Expand Up @@ -89,7 +94,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/2.1.0...HEAD
[Unreleased]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.2.0...HEAD
[2.2.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.1.0...2.2.0
[2.1.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/2.0.0...2.1.0
[2.0.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/1.8.0...2.0.0
[1.8.0]: https://github.com/npalm/terraform-aws-gitlab-runner/compare/1.7.0...1.8.0
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,29 +115,30 @@ module "gitlab-runner" {
| ami_filter | AMI filter to select the AMI used to host the gitlab runner agent. By default the pattern `amzn-ami-hvm-2018.03*-x86_64-ebs` is used for the name. Currently Amazon Linux 2 `amzn2-ami-hvm-2.0.????????-x86_64-ebs` looks *not* working for this configuration. | list | `<list>` | no |
| ami_owners | A list of owners used to select the AMI for the instance. | list | `<list>` | no |
| aws_region | AWS region. | string | - | yes |
| aws_zone | AWS availability zone (typically 'a', 'b', or 'c'). | string | `a` | no |
| cache_bucket_prefix | Prefix for s3 cache bucket name. | string | `` | no |
| cache_expiration_days | Number of days before cache objects expires. | string | `1` | no |
| cache_shared | Enables cache sharing between runners, false by default. | string | `false` | no |
| create_runners_iam_instance_profile | | string | `true` | no |
| docker_machine_instance_type | Instance type used for the instances hosting docker-machine. | string | `m4.large` | no |
| docker_machine_options | Additional to set options for docker machien. Each element of the list should be key and value. E.g. '["--amazonec2-zone=a"]' | list | `<list>` | no |
| docker_machine_options | Additional to set options for docker machine. Each element of the list should be key and value. E.g. '["amazonec2-zone=a"]' | list | `<list>` | no |
| docker_machine_spot_price_bid | Spot price bid. | string | `0.04` | no |
| docker_machine_user | User name for the user to create spot instances to host docker-machine. | string | `docker-machine` | no |
| docker_machine_version | Version of docker-machine. | string | `0.16.0` | no |
| docker_machine_version | Version of docker-machine. | string | `0.16.1` | no |
| enable_cloudwatch_logging | Enable or disable the CloudWatch logging. | string | `1` | no |
| environment | A name that identifies the environment, will used as prefix and for tagging. | string | - | yes |
| gitlab_runner_version | Version for the gitlab runner. | string | `11.6.0` | no |
| gitlab_runner_version | Version for the gitlab runner. | string | `11.8.0` | no |
| instance_role_json | Instance role json for the runner agent ec2 instance to override the default. | string | `` | no |
| instance_role_runner_json | Instance role json for the docker machine runners to override the default. | string | `` | no |
| instance_type | Instance type used for the gitlab-runner. | string | `t2.micro` | no |
| runners_concurrent | Concurrent value for the runners, will be used in the runner config.toml | string | `10` | no |
| runners_executor | The executor to use. Currently supports docker+machine or docker | string | `docker+machine` | no |
| runners_gitlab_url | URL of the gitlab instance to connect to. | string | - | yes |
| runners_iam_instance_profile_name | IAM instance profile name of the runners, will be used in the runner config.toml | string | `` | no |
| runners_idle_count | Idle count of the runners, will be used in the runner config.toml | string | `0` | no |
| runners_idle_time | Idle time of the runners, will be used in the runner config.toml | string | `600` | no |
| runners_image | Image to run builds, will be used in the runner config.toml | string | `docker:18.03.1-ce` | no |
| runners_limit | Limit for the runners, will be used in the runner config.toml | string | `0` | no |
| runners_machine_iam_instance_profile_name | IAM instance profile name to assign to the spot instance which runs the build. | string | `` | no |
| runners_monitoring | Enable detailed cloudwatch monitoring for spot instances. | string | `false` | no |
| runners_name | Name of the runner, will be used in the runner config.toml | string | - | yes |
| runners_off_peak_idle_count | Off peak idle count of the runners, will be used in the runner config.toml. | string | `0` | no |
Expand All @@ -154,8 +155,8 @@ module "gitlab-runner" {
| runners_token | Token for the runner, will be used in the runner config.toml | string | - | yes |
| runners_use_private_address | Restrict runners to use only private address | string | `true` | no |
| ssh_public_key | Public SSH key used for the gitlab-runner ec2 instance. | string | - | yes |
| subnet_ids_gitlab_runner | Subnets used for hosting the gitlab-runner. | list | - | yes |
| subnet_id_runners | Subnet used to hosts the docker-machine runners. | string | - | yes |
| subnet_ids_gitlab_runner | Subnet used for hosting the gitlab-runner. | list | - | yes |
| tags | Map of tags that will be added to created resources. By default resources will be taggen with name and environemnt. | map | `<map>` | no |
| userdata_post_install | User-data script snippet to insert after gitlab-runner install | string | `` | no |
| userdata_pre_install | User-data script snippet to insert before gitlab-runner install | string | `` | no |
Expand Down
3 changes: 2 additions & 1 deletion examples/runner-public/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "vpc" {
name = "vpc-${var.environment}"
cidr = "10.1.0.0/16"

azs = ["eu-west-1a"]
azs = ["eu-west-1b"]
public_subnets = ["10.1.101.0/24"]

tags = {
Expand All @@ -26,6 +26,7 @@ module "runner" {
vpc_id = "${module.vpc.vpc_id}"
subnet_ids_gitlab_runner = "${module.vpc.public_subnets}"
subnet_id_runners = "${element(module.vpc.public_subnets, 0)}"
aws_zone = "b"

runners_name = "${var.runner_name}"
runners_gitlab_url = "${var.gitlab_url}"
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ data "template_file" "runners" {

runners_vpc_id = "${var.vpc_id}"
runners_subnet_id = "${var.subnet_id_runners}"
runners_aws_zone = "${var.aws_zone}"
runners_instance_type = "${var.docker_machine_instance_type}"
runners_spot_price_bid = "${var.docker_machine_spot_price_bid}"
runners_security_group_name = "${aws_security_group.docker_machine.name}"
Expand Down
1 change: 1 addition & 0 deletions template/runner-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ check_interval = 0
MachineOptions = [
"amazonec2-instance-type=${runners_instance_type}",
"amazonec2-region=${aws_region}",
"amazonec2-zone=${runners_aws_zone}",
"amazonec2-vpc-id=${runners_vpc_id}",
"amazonec2-subnet-id=${runners_subnet_id}",
"amazonec2-private-address-only=${runners_use_private_address}",
Expand Down
12 changes: 9 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ variable "aws_region" {
type = "string"
}

variable "aws_zone" {
description = "AWS availability zone (typically 'a', 'b', or 'c')."
type = "string"
default = "a"
}

variable "environment" {
description = "A name that identifies the environment, will used as prefix and for tagging."
type = "string"
Expand Down Expand Up @@ -46,7 +52,7 @@ variable "docker_machine_spot_price_bid" {

variable "docker_machine_version" {
description = "Version of docker-machine."
default = "0.16.0"
default = "0.16.1"
}

variable "runners_name" {
Expand Down Expand Up @@ -214,7 +220,7 @@ variable "cache_shared" {
variable "gitlab_runner_version" {
description = "Version for the gitlab runner."
type = "string"
default = "11.6.0"
default = "11.8.0"
}

variable "enable_cloudwatch_logging" {
Expand All @@ -234,7 +240,7 @@ variable "allow_iam_service_linked_role_creation" {
}

variable "docker_machine_options" {
description = "Additional to set options for docker machien. Each element of the list should be key and value. E.g. '[\"--amazonec2-zone=a\"]'"
description = "Additional to set options for docker machine. Each element of the list should be key and value. E.g. '[\"amazonec2-zone=a\"]'"
type = "list"
default = []
}
Expand Down

0 comments on commit 4b85921

Please sign in to comment.