-
-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CI added through Travis - tests passing * moved travis badge to official org builds
- Loading branch information
1 parent
b5a4c76
commit 5e7184c
Showing
11 changed files
with
240 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
language: ruby | ||
|
||
sudo: false | ||
|
||
dist: trusty | ||
|
||
rvm: | ||
- 2.4.2 | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
- echo "before_install" | ||
|
||
install: | ||
- echo "install" | ||
- gem install bundler --no-rdoc --no-ri | ||
- bundle install | ||
|
||
before_script: | ||
- echo 'before_script' | ||
# Get a random variable from the awscli and use it through the remainder of the test cycle. | ||
- export AWS_REGION=$(docker run --env AWS_DEFAULT_REGION=us-east-2 --env AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} --env AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} garland/aws-cli-docker aws ec2 describe-regions --query 'Regions[].{Name:RegionName}' --output text | shuf | head -n1) | ||
- echo "using AWS_REGION=${AWS_REGION}" | ||
- export TF_VAR_region=${AWS_REGION} | ||
- wget https://releases.hashicorp.com/terraform/0.10.7/terraform_0.10.7_linux_amd64.zip | ||
- unzip terraform_0.10.7_linux_amd64 | ||
- chmod +x terraform | ||
- mkdir -p ${HOME}/bin | ||
- export PATH=${PATH}:${HOME}/bin | ||
- mv terraform ${HOME}/bin/ | ||
- rm -f terraform_* | ||
- terraform -v | ||
|
||
script: | ||
- echo 'before_script' | ||
# no terraform through docker until kitchen-terraform supports it | ||
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light init | ||
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light fmt -check=true | ||
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light validate | ||
- terraform init | ||
- terraform fmt -check=true | ||
- terraform validate -var "region=${AWS_REGION}" -var "certificate_arn=arn:aws:iam::123456789012:server-certificate/test_cert-123456789012" -var "health_check_path=/" -var "subnets=[]" -var "vpc_id=vpc-abcde012" -var "alb_name=my-alb" -var "alb_security_groups=[]" | ||
- docker run --rm -v $(pwd):/app/ --workdir=/app/ -t wata727/tflint --error-with-issues | ||
- cd examples/test_fixtures | ||
# this line is to change the source of the root module to 2 dirs back which works when validating in CI but when running through test kitchen, we need to source from 3 dirs up, oddly | ||
- sed -i.bak 's/\.\.\/\.\.\/\.\./\.\.\/\.\./g' main.tf | ||
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light init | ||
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light fmt -check=true | ||
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light validate | ||
- terraform init | ||
- terraform fmt -check=true | ||
- terraform validate | ||
# FIXME: tflint is unhappy with sourcing a module from a relative dir here. | ||
# - docker run --rm -v $(pwd):/data --workdir=/data -t wata727/tflint --error-with-issues | ||
- mv main.tf.bak main.tf | ||
- cd - | ||
- pwd | ||
- ls -lah | ||
- terraform -v | ||
- kitchen test --destroy always | ||
|
||
# after_success: | ||
# - echo 'after_success' | ||
|
||
# after_failure: | ||
# - echo 'after_failure' | ||
|
||
before_deploy: | ||
# check if this is new release and conditionally continue? | ||
- echo 'before_deploy phase' | ||
|
||
deploy: | ||
# likely want to publish to the registry | ||
provider: script | ||
script: ci/deploy.sh | ||
on: | ||
branch: dev | ||
|
||
# after_deploy: | ||
# notify of success/failure provide links | ||
# - echo 'after_deploy' | ||
|
||
# after_script: | ||
# - echo 'after_script' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# this file is a placeholder. Not sure that the registry API is available yet. | ||
echo "Deployment steps should include publishing to terraform registry on new releases. Exiting with success." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
data "aws_caller_identity" "fixtures" {} | ||
|
||
data "aws_availability_zones" "available" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.