Skip to content

Commit

Permalink
Merge branch 'master' of github.com:npalm/terraform-aws-gitlab-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Jul 14, 2018
2 parents aa3ba26 + 6457ed6 commit ebdcd3e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHNAGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Changed
- Add parameter for docker machine version
- Upgrade default gitlab runner version to 11.0.0
- Upgrade default docker-machine version to 0.15.0

## [1.0.2] - 2018-06-22
### Changed
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module "gitlab-runner" {

All variables and defaults:


| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| amazon_optimized_amis | AMI map per region-zone for the gitlab-runner instance AMI. | map | `<map>` | no |
Expand All @@ -83,9 +84,10 @@ All variables and defaults:
| docker_machine_instance_type | Instance type used for the instances hosting docker-machine. | string | `m4.large` | 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.15.0` | 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 | `10.8.0` | no |
| gitlab_runner_version | Version for the gitlab runner. | string | `11.0.0` | 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_gitlab_url | URL of the gitlab instance to connect to. | string | - | yes |
Expand Down
4 changes: 0 additions & 4 deletions bucket.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
data "aws_caller_identity" "current" {}

output "account_id" {
value = "${data.aws_caller_identity.current.account_id}"
}

resource "aws_s3_bucket" "build_cache" {
bucket = "${data.aws_caller_identity.current.account_id}-gitlab-runner-cache"
acl = "private"
Expand Down
7 changes: 4 additions & 3 deletions examples/runner/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ environment = "ci"
aws_region = "eu-west-1"

# Add the following variables:
# runner_name = ""
# gitlab_url = ""
# runner_token = ""
runner_name = ""

gitlab_url = ""

runner_token = ""
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ data "template_file" "gitlab_runner" {
template = "${file("${path.module}/template/gitlab-runner.tpl")}"

vars {
gitlab_runner_version = "${var.gitlab_runner_version}"
runners_config = "${data.template_file.runners.rendered}"
gitlab_runner_version = "${var.gitlab_runner_version}"
docker_machine_version = "${var.docker_machine_version}"
runners_config = "${data.template_file.runners.rendered}"
}
}

Expand Down
2 changes: 1 addition & 1 deletion template/gitlab-runner.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EOF

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | bash
yum install gitlab-runner-${gitlab_runner_version} -y
curl -L https://github.com/docker/machine/releases/download/v0.13.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && \
curl -L https://github.com/docker/machine/releases/download/v${docker_machine_version}/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && \
chmod +x /tmp/docker-machine && \
cp /tmp/docker-machine /usr/local/bin/docker-machine && \
ln -s /usr/local/bin/docker-machine /usr/bin/docker-machine
Expand Down
7 changes: 6 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ variable "docker_machine_spot_price_bid" {
default = "0.04"
}

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

variable "runners_name" {
description = "Name of the runner, will be used in the runner config.toml"
type = "string"
Expand Down Expand Up @@ -128,7 +133,7 @@ variable "cache_expiration_days" {
variable "gitlab_runner_version" {
description = "Version for the gitlab runner."
type = "string"
default = "10.8.0"
default = "11.0.0"
}

variable "enable_cloudwatch_logging" {
Expand Down

0 comments on commit ebdcd3e

Please sign in to comment.