Skip to content

Commit

Permalink
Merge branch 'release/3.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Jul 4, 2019
2 parents 10e6b40 + 91be174 commit 903dd8f
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ 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.6.0 - 2019-07-04
- Changed
- Add option to specify pull policy for docker images by the runner. @roock
- Docker machine AMI image will be by default latest ubuntu 16.06, can be overwritten via variables @roock
- Improved CI docs generation script @roock

## 3.5.0 - 2019-06-19
- Changed
- Documentation #85: Misleading Variable-Description @ solutionDrive-Alt
- Documentation #85: Misleading Variable-Description @solutionDrive-Alt
- Bugfix #70: docker-machine fails starting runners when `amazonec2-request-spot-instance=false` @philippefuentes
- Bugfix #72: Detect and retry when docker machine installation fails @eliasdorneles
- Changed: Default version of GitLab runner set to 11.11.2
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ terraform destroy
| instance\_type | Instance type used for the GitLab runner. | string | `"t3.micro"` | no |
| name\_runners\_docker\_machine | | string | `""` | no |
| overrides | This maps provides the possibility to override some defaults. The following attributes are supported: `name_sg` overwrite the `Name` tag for all security groups created by this module. `name_runner_agent_instance` override the `Name` tag for the ec2 instance defined in the auto launch configuration. `name_docker_machine_runners` ovverrid the `Name` tag spot instances created by the runner agent. | map | `<map>` | no |
| runner\_ami\_filter | List of maps used to create the AMI filter for the Gitlab runner docker-machine AMI. | list | `<list>` | no |
| runner\_ami\_owners | The list of owners used to select the AMI of Gitlab runner docker-machine instances. | list | `<list>` | no |
| runner\_instance\_spot\_price | By setting a spot price bid price the runner agent will be created via a spot request. Be aware that spot instances can be stopped by AWS. | string | `""` | no |
| runners\_concurrent | Concurrent value for the runners, will be used in the runner config.toml. | string | `"10"` | no |
| runners\_environment\_vars | Environment variables during build execution, e.g. KEY=Value, see runner-public example. Will be used in the runner config.toml | list | `<list>` | no |
Expand Down
2 changes: 2 additions & 0 deletions _docs/TF_MODULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
| instance\_type | Instance type used for the GitLab runner. | string | `"t3.micro"` | no |
| name\_runners\_docker\_machine | | string | `""` | no |
| overrides | This maps provides the possibility to override some defaults. The following attributes are supported: `name_sg` overwrite the `Name` tag for all security groups created by this module. `name_runner_agent_instance` override the `Name` tag for the ec2 instance defined in the auto launch configuration. `name_docker_machine_runners` ovverrid the `Name` tag spot instances created by the runner agent. | map | `<map>` | no |
| runner\_ami\_filter | List of maps used to create the AMI filter for the Gitlab runner docker-machine AMI. | list | `<list>` | no |
| runner\_ami\_owners | The list of owners used to select the AMI of Gitlab runner docker-machine instances. | list | `<list>` | no |
| runner\_instance\_spot\_price | By setting a spot price bid price the runner agent will be created via a spot request. Be aware that spot instances can be stopped by AWS. | string | `""` | no |
| runners\_concurrent | Concurrent value for the runners, will be used in the runner config.toml. | string | `"10"` | no |
| runners\_environment\_vars | Environment variables during build execution, e.g. KEY=Value, see runner-public example. Will be used in the runner config.toml | list | `<list>` | no |
Expand Down
6 changes: 3 additions & 3 deletions ci/bin/autodocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# script to auto-generate terraform documentation

pandoc -v &> /dev/null || echo "ERROR: Pandoc not installed"
terraform-docs --version &> /dev/null || echo "ERROR: terraform-docs not installed"
pandoc -v &> /dev/null || { echo >&2 "ERROR: Pandoc not installed" ; exit 1 ; }
terraform-docs --version &> /dev/null || { echo >&2 "ERROR: terraform-docs not installed" ; exit 1 ; }

IFS=$'\n'
# create an array of all unique directories containing .tf files
Expand Down Expand Up @@ -39,4 +39,4 @@ do
elif [[ ! -d "$docs_dir" && $i != *".terraform"* ]]; then
terraform-docs markdown table $i > README.md
fi
done
done
3 changes: 2 additions & 1 deletion ci/bin/verify-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ DIR=${1:-examples}
source $(dirname $0)/terraform.sh

EXAMPLES="$(find ${DIR} -maxdepth 1 -mindepth 1 -type d 2> /dev/null )"
if [[ -z $EXAMPLES || "$($(echo $EXAMPLES) | wc -l)" -gt 0 ]] ; then
echo $EXAMPLES
if [[ -z $EXAMPLES || $( echo $EXAMPLES | wc -l ) -eq 0 ]] ; then
echo "No example(s) directories found."
exit 1
fi
Expand Down
9 changes: 9 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ data "template_file" "runners" {
runners_subnet_id = "${var.subnet_id_runners}"
runners_aws_zone = "${var.aws_zone}"
runners_instance_type = "${var.docker_machine_instance_type}"
runners_ami = "${data.aws_ami.docker-machine.id}"
runners_spot_price_bid = "${var.docker_machine_spot_price_bid}"
runners_security_group_name = "${aws_security_group.docker_machine.name}"
runners_monitoring = "${var.runners_monitoring}"
Expand Down Expand Up @@ -199,6 +200,14 @@ resource "aws_autoscaling_group" "gitlab_runner_instance" {
]
}

data "aws_ami" "docker-machine" {
most_recent = true

filter = "${var.runner_ami_filter}"

owners = ["${var.runner_ami_owners}"]
}

data "aws_ami" "runner" {
most_recent = "true"

Expand Down
3 changes: 2 additions & 1 deletion template/runner-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ check_interval = 0
"amazonec2-tags=${runners_tags}",
"amazonec2-monitoring=${runners_monitoring}",
"amazonec2-iam-instance-profile=${runners_instance_profile}",
"amazonec2-root-size=${runners_root_size}"
"amazonec2-root-size=${runners_root_size}",
"amazonec2-ami=${runners_ami}"
${docker_machine_options}
]
OffPeakTimezone = "${runners_off_peak_timezone}"
Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,24 @@ variable "ami_owners" {
default = ["amazon"]
}

variable "runner_ami_filter" {
description = "List of maps used to create the AMI filter for the Gitlab runner docker-machine AMI."
type = "list"

default = [{
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*"]
}]
}

variable "runner_ami_owners" {
description = "The list of owners used to select the AMI of Gitlab runner docker-machine instances."
type = "list"

# Canonical
default = ["099720109477"]
}

variable "gitlab_runner_registration_config" {
description = "Configuration used to register the runner. See the README for an example, or reference the examples in the examples directory of this repo."
type = "map"
Expand Down

0 comments on commit 903dd8f

Please sign in to comment.