Skip to content

Instantly share code, notes, and snippets.

@danikgithub
danikgithub / pre-commit
Created October 7, 2021 10:39 — forked from jamtur01/pre-commit
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f
@danikgithub
danikgithub / Jenkinsfile
Created June 27, 2021 04:34 — forked from geekbass/Jenkinsfile
Jenkins Pipeline using Terraform, Ansible Vault and Gitlab
#!groovy
node {
def err = null
def environment = "Development"
currentBuild.result = "SUCCESS"
load "$JENKINS_HOME/.envvars/.env.groovy"
try {