Skip to content

Commit

Permalink
Setup TravisCI (#2)
Browse files Browse the repository at this point in the history
* Setup TravisCI

* Fix pre-commit docs
  • Loading branch information
cjonesy authored Jul 13, 2021
1 parent e3c6896 commit 3dd4f65
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
os: linux
dist: xenial
language: python

env:
- TERRAFORM_VERSION=1.0.2 TERRAFORM_DOCS_VERSION=0.14.1

install:
# Install pre-commit
- pip install pre-commit

# Install terraform
- curl -Lo terraform.zip "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
- unzip terraform.zip
- mv terraform ${HOME}/bin/terraform

# Install terraform-docs
- curl -Lo ./terraform-docs.tar.gz "https://github.com/terraform-docs/terraform-docs/releases/download/v${TERRAFORM_DOCS_VERSION}/terraform-docs-v${TERRAFORM_DOCS_VERSION}-linux-amd64.tar.gz"
- tar -xzf terraform-docs.tar.gz
- mv terraform-docs ${HOME}/bin/terraform-docs

jobs:
include:
- stage: lint
name: pre-commit hooks
script:
- pre-commit run --all-files --show-diff-on-failure

cache:
pip: true
directories:
- $HOME/.cache/pre-commit
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# terraform-google-cloud-build-slack-notifier

[![Build Status](https://www.travis-ci.com/simplifi/terraform-google-cloud-build-slack-notifier.svg?token=Tyt37RU5xWf1sPRSJyoD&branch=main)](https://www.travis-ci.com/simplifi/terraform-google-cloud-build-slack-notifier)

A Terraform module to enable Slack notifications for Cloud Build events.

**Note - This will add the following resources to your project:**
Expand All @@ -26,8 +28,11 @@ secret for this to work.
The enabled hooks check for a variety of common problems in Terraform code, and
will run any time you commit to your branch.

Pre-commit (and dependencies) can be installed by running:
`brew install pre-commit coreutils terraform-docs`
Pre-commit (and dependencies) can be installed by following the instructions
found here:

- [Install `pre-commit`](https://pre-commit.com/#install)
- [Install `terraform-docs`](https://github.com/terraform-docs/terraform-docs#installation)

To enable the hooks locally, run the following from the root of this repo:
`pre-commit install`
Expand Down

0 comments on commit 3dd4f65

Please sign in to comment.