Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add travis integration #15

Merged
merged 6 commits into from
Jan 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
dist: bionic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for going with a particular release of Ubuntu? We've usually just set the os to linux and used what Travis defaults to for this but there have been some cases where we've had to use a specific version (e.g. for Java 7 usage).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason in particular other than it's equivalent to the latest version of ubuntu available in travis and to be more explicit in what we call out for the build environment. When we call out linux it looks like it should default to what Travis has set as the default linux image (The current default is ubuntu 16.04)


env:
- TERRAFORM_DIR=main
- TERRAFORM_DIR=lambda

# Install terraform
before_install:
- curl -sLo /tmp/terraform.zip https://releases.hashicorp.com/terraform/0.12.19/terraform_0.12.19_linux_amd64.zip
- unzip /tmp/terraform.zip -d /tmp
- mkdir -p ~/bin
- mv /tmp/terraform ~/bin
- export PATH="~/bin:$PATH"
- export TF_INPUT=false
- export AWS_DEFAULT_REGION="us-east-1"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set AWS_DEFAULT_REGION as per hashicorp/terraform#21408 (comment) to not fail on implicit provider defaults.


script:
- cd $TERRAFORM_DIR
- terraform init
- terraform validate
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Travis build matrix to effectively run a pipeline that validates the main & lambda dirs in this repository