-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from telia-oss/use-templatefile-function
Prepare for v2 release
- Loading branch information
Showing
7 changed files
with
81 additions
and
48 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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
dist: trusty | ||
sudo: false | ||
language: go | ||
|
||
before_install: | ||
- curl -fSL "https://releases.hashicorp.com/terraform/0.12.3/terraform_0.12.3_linux_amd64.zip" -o terraform.zip | ||
- sudo unzip terraform.zip -d /opt/terraform | ||
- sudo ln -s /opt/terraform/terraform /usr/bin/terraform | ||
- rm -f terraform.zip | ||
- curl -fSL https://github.com/wata727/tflint/releases/download/v0.7.0/tflint_linux_amd64.zip -o tflint.zip | ||
- sudo unzip tflint.zip -d /opt/tflint | ||
- sudo ln -s /opt/tflint/tflint /usr/bin/tflint | ||
- rm -f tflint.zip | ||
go: | ||
- 1.12.x | ||
|
||
env: | ||
- GO111MODULE=on | ||
|
||
notifications: | ||
email: false | ||
|
||
install: | ||
- curl -sL https://taskfile.dev/install.sh | sh | ||
- curl -sL https://releases.hashicorp.com/terraform/0.12.7/terraform_0.12.7_linux_amd64.zip -o terraform.zip | ||
- sudo unzip terraform.zip -d /usr/bin && rm -f terraform.zip | ||
|
||
script: | ||
- make | ||
- ./bin/task test |
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,48 @@ | ||
version: '2' | ||
|
||
env: | ||
AWS_DEFAULT_REGION: eu-west-1 | ||
GO111MODULE: on | ||
|
||
tasks: | ||
default: | ||
cmds: | ||
- task: test | ||
|
||
test: | ||
desc: Run tests for all terraform directories. | ||
silent: true | ||
env: | ||
DIRECTORIES: | ||
sh: find . -type f -name '*.tf' -not -path "**/.terraform/*" -exec dirname {} \; | sort -u | ||
cmds: | ||
- | | ||
BOLD=$(tput bold) | ||
NORM=$(tput sgr0) | ||
CWD=$PWD | ||
for d in $DIRECTORIES; do | ||
cd $d | ||
echo "${BOLD}$PWD:${NORM}" | ||
if ! terraform fmt -check=true -write=true -list=false -recursive=false; then | ||
echo " ✗ terraform fmt" && exit $? | ||
else | ||
echo " √ terraform fmt" | ||
fi | ||
if ! terraform init -backend=false -input=false -get=true -get-plugins=true -no-color > /dev/null; then | ||
echo " ✗ terraform init" && exit $? | ||
else | ||
echo " √ terraform init" | ||
fi | ||
if ! terraform validate > /dev/null; then | ||
echo " ✗ terraform validate" && exit $? | ||
else | ||
echo " √ terraform validate" | ||
fi | ||
cd $CWD | ||
done |
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