From 34aa3a52f8fda3faef982085cea82e2d0e47c556 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 22 Feb 2020 20:41:04 +0000 Subject: [PATCH] Restructure helper scripts so they're slightly more useful --- .github/workflows/ansible.yml | 4 ++-- .github/workflows/terraform.yml | 4 ++-- scripts/{ansible.sh => ansible/deploy.sh} | 0 scripts/{ansible-lint.sh => ansible/lint.sh} | 0 scripts/{ => ansible}/setup.sh | 0 scripts/deploy.sh | 5 ----- scripts/terraform-lint.sh | 11 ----------- scripts/terraform/lint.sh | 7 +++++++ scripts/{ => terraform}/terraform.sh | 0 9 files changed, 11 insertions(+), 20 deletions(-) rename scripts/{ansible.sh => ansible/deploy.sh} (100%) rename scripts/{ansible-lint.sh => ansible/lint.sh} (100%) rename scripts/{ => ansible}/setup.sh (100%) delete mode 100755 scripts/deploy.sh delete mode 100755 scripts/terraform-lint.sh create mode 100755 scripts/terraform/lint.sh rename scripts/{ => terraform}/terraform.sh (100%) diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml index 65c1b8d..fbdc7ce 100644 --- a/.github/workflows/ansible.yml +++ b/.github/workflows/ansible.yml @@ -12,6 +12,6 @@ jobs: with: python-version: 3.7 - name: Install dependencies - run: ./scripts/setup.sh + run: ./scripts/ansible/setup.sh - name: Run linters - run: ./scripts/ansible-lint.sh + run: ./scripts/ansible/lint.sh diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 9c49242..ddb612f 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -12,6 +12,6 @@ jobs: with: version: "0.12.20" - name: Initialize Terraform - run: cd terraform/ && terraform init + run: ./scripts/terraform/terraform.sh init - name: Lint - run: ./scripts/terraform-lint.sh + run: ./scripts/terraform/lint.sh diff --git a/scripts/ansible.sh b/scripts/ansible/deploy.sh similarity index 100% rename from scripts/ansible.sh rename to scripts/ansible/deploy.sh diff --git a/scripts/ansible-lint.sh b/scripts/ansible/lint.sh similarity index 100% rename from scripts/ansible-lint.sh rename to scripts/ansible/lint.sh diff --git a/scripts/setup.sh b/scripts/ansible/setup.sh similarity index 100% rename from scripts/setup.sh rename to scripts/ansible/setup.sh diff --git a/scripts/deploy.sh b/scripts/deploy.sh deleted file mode 100755 index 3ab4df1..0000000 --- a/scripts/deploy.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -./scripts/ansible.sh diff --git a/scripts/terraform-lint.sh b/scripts/terraform-lint.sh deleted file mode 100755 index 7c456df..0000000 --- a/scripts/terraform-lint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd terraform/ - -set -x - -terraform validate - -terraform fmt -check -recursive diff --git a/scripts/terraform/lint.sh b/scripts/terraform/lint.sh new file mode 100755 index 0000000..6dabb86 --- /dev/null +++ b/scripts/terraform/lint.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -ex + +./scripts/terraform/terraform.sh validate + +./scripts/terraform/terraform.sh fmt -check -recursive diff --git a/scripts/terraform.sh b/scripts/terraform/terraform.sh similarity index 100% rename from scripts/terraform.sh rename to scripts/terraform/terraform.sh