Skip to content

Commit 5e06ce2

Browse files
authored
Improvements (#5)
### Added - Add variable to enable cloudwatch monitoring for spot instances, by default disabled. - Add off peak runner settings. - Add file system root size for runners. ### Changed - Refactored example, key generation is part of terraform.
1 parent 735a424 commit 5e06ce2

File tree

18 files changed

+157
-53
lines changed

18 files changed

+157
-53
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
dist: trusty
22
sudo: false
33

4+
install:
5+
- ./ci/bin/install.sh
6+
47
jobs:
58
include:
69
- stage: verify
7-
script: ./ci/bin/verify.sh 0.11.7 .
10+
script: ./ci/bin/verify.sh
811
- stage: verify
9-
script: ./ci/bin/verify-examples.sh 0.11.7 examples
12+
script: ./ci/bin/verify-examples.sh examples

CHNAGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Added
9+
- Add variable to enable cloudwatch monitoring for spot instances, by default disabled.
10+
- Add off peak runner settings.
11+
- Add file system root size for runners.
12+
13+
### Changed
14+
- Refactored example, key generation is part of terraform.
815

916
## [1.0.3] - 2018-07-14
1017
### Changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ module "gitlab-runner" {
7474

7575
All variables and defaults:
7676

77-
7877
| Name | Description | Type | Default | Required |
7978
|------|-------------|:----:|:-----:|:-----:|
8079
| amazon_optimized_amis | AMI map per region-zone for the gitlab-runner instance AMI. | map | `<map>` | no |
@@ -94,8 +93,14 @@ All variables and defaults:
9493
| runners_idle_count | Idle count of the runners, will be used in the runner config.toml | string | `0` | no |
9594
| runners_idle_time | Idle time of the runners, will be used in the runner config.toml | string | `600` | no |
9695
| runners_limit | Limit for the runners, will be used in the runner config.toml | string | `0` | no |
96+
| runners_monitoring | Enable detailed cloudwatch monitoring for spot instances. | string | `false` | no |
9797
| runners_name | Name of the runner, will be used in the runner config.toml | string | - | yes |
98+
| runners_off_peak_idle_count | Off peak idle count of the runners, will be used in the runner config.toml. | string | `0` | no |
99+
| runners_off_peak_idle_time | Off peak idle time of the runners, will be used in the runner config.toml. | string | `0` | no |
100+
| runners_off_peak_periods | Off peak periods of the runners, will be used in the runner config.toml. | string | `` | no |
101+
| runners_off_peak_timezone | Off peak idle time zone of the runners, will be used in the runner config.toml. | string | `` | no |
98102
| runners_privilled | Runners will run in privilled mode, will be used in the runner config.toml | string | `true` | no |
103+
| runners_root_size | Runnner instance root size in GB. | string | `16` | no |
99104
| runners_token | Token for the runner, will be used in the runner config.toml | string | - | yes |
100105
| ssh_public_key | Public SSH key used for the gitlab-runner ec2 instance. | string | - | yes |
101106
| subnet_id_gitlab_runner | Subnet used for hosting the gitlab-runner. | string | - | yes |

ci/bin/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
source $(dirname "${BASH_SOURCE[0]}")/terraform.sh
4+
5+
installTerraform

ci/bin/run-local.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
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

ci/bin/terraform.sh

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

3-
OS=${TRAVIS_OS_NAME}
43
TARGET_DIR=/opt
4+
PATH=${PATH}:${TARGET_DIR}
5+
6+
TERRAFORM_VERSION=${1:-"0.11.7"}
7+
OS=${2:-"linux"}
58
TERRAFORM_URL="https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${OS}_amd64.zip"
69

710
installTerraform() {
@@ -10,8 +13,6 @@ installTerraform() {
1013
curl '-#' -fL -o ${TARGET_DIR}/terraform.zip ${TERRAFORM_URL} && \
1114
unzip -q -d ${TARGET_DIR}/ ${TARGET_DIR}/terraform.zip && \
1215

13-
export PATH=${PATH}:${TARGET_DIR}
14-
1516
terraform --version
1617
}
1718

ci/bin/verify-examples.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/env bash
2-
TERRAFORM_VERSION=$1
3-
DIR=$2
2+
DIR=${1:-examples}
43

5-
source $(dirname "${BASH_SOURCE[0]}")/terraform.sh
6-
installTerraform
4+
source $(dirname $0)/terraform.sh
75

8-
EXAMPLES="$(find ${DIR} -type d -mindepth 1 2> /dev/null )"
6+
EXAMPLES="$(find ${DIR} -maxdepth 1 -mindepth 1 -type d 2> /dev/null )"
97
if [[ -z $EXAMPLES || "$($(echo $EXAMPLES) | wc -l)" -gt 0 ]] ; then
108
echo "No example(s) directories found."
119
exit 1

ci/bin/verify.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env bash
2-
TERRAFORM_VERSION=$1
32

4-
source $(dirname "${BASH_SOURCE[0]}")/terraform.sh
3+
source $(dirname $0)/terraform.sh
54

6-
installTerraform
75
validate
86
verifyModulesAndPlugins

examples/runner/generated/.gitkeep

Whitespace-only changes.

examples/runner/init.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)