From a939cc3f16772f8f5e1bb1c2ef5c7bf2e263d51e Mon Sep 17 00:00:00 2001 From: Matt White <16320656+matt-FFFFFF@users.noreply.github.com> Date: Thu, 25 Jan 2024 19:06:46 +0000 Subject: [PATCH] fix: grept apply (#4) Co-authored-by: github-actions[bot] Co-authored-by: Charles J Shea <58995422+cshea-msft@users.noreply.github.com> --- .github/workflows/e2e.yml | 3 ++- .github/workflows/linting.yml | 24 ++++++++++++++++++++++-- .gitignore | 3 +++ .terraform-docs.yml | 2 +- Makefile | 4 +++- SUPPORT.md | 2 +- avm | 21 +++++++++++++++++++++ avm.bat | 23 +++++++++++++++++++++++ examples/.terraform-docs.yml | 2 +- 9 files changed, 77 insertions(+), 7 deletions(-) create mode 100755 avm create mode 100644 avm.bat diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 447f2a4..dcf4228 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -27,7 +27,7 @@ jobs: testexamples: if: github.event.repository.name != 'terraform-azurerm-avm-template' - runs-on: [ self-hosted, 1ES.Pool= ] + runs-on: [ self-hosted, 1ES.Pool=terraform-azurerm-avm-res-network-firewall ] needs: getexamples environment: test env: @@ -37,6 +37,7 @@ jobs: matrix: example: ${{ fromJson(needs.getexamples.outputs.examples) }} max-parallel: 5 + fail-fast: false steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index ddf2501..1e61d8d 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -15,9 +15,10 @@ concurrency: cancel-in-progress: true jobs: - linting: + docs: if: github.event.repository.name != 'terraform-azurerm-avm-template' - name: linting + name: docs + runs-on: ubuntu-latest steps: - name: checkout repository @@ -26,7 +27,26 @@ jobs: - name: check docs uses: Azure/terraform-azurerm-avm-template/.github/actions/docs-check@main + terraform: + if: github.event.repository.name != 'terraform-azurerm-avm-template' + name: terraform + runs-on: ubuntu-latest + steps: + - name: checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + - name: lint terraform uses: Azure/terraform-azurerm-avm-template/.github/actions/linting@main with: github-token: ${{ secrets.GITHUB_TOKEN }} + + avmfix: + if: github.event.repository.name != 'terraform-azurerm-avm-template' && false + name: avmfix + runs-on: ubuntu-latest + steps: + - name: checkout repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 + + - name: avmfix + uses: Azure/terraform-azurerm-avm-template/.github/actions/avmfix@main diff --git a/.gitignore b/.gitignore index ab61670..ee6ea77 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,10 @@ override.tf.json .terraformrc terraform.rc *tfplan* +.terraform.lock.hcl README-generated.md avm.tflint.hcl +avm.tflint.merged.hcl avm.tflint_example.hcl +avm.tflint_example.merged.hcl avmmakefile diff --git a/.terraform-docs.yml b/.terraform-docs.yml index 743216c..dd5d16b 100644 --- a/.terraform-docs.yml +++ b/.terraform-docs.yml @@ -4,7 +4,7 @@ formatter: "markdown document" # this is required -version: "0.16.0" +version: "~> 0.17.0" header-from: "_header.md" footer-from: "_footer.md" diff --git a/Makefile b/Makefile index 1a41699..cf759bb 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ SHELL := /bin/bash -$(shell curl -H 'Cache-Control: no-cache, no-store' -sSL "https://raw.githubusercontent.com/Azure/tfmod-scaffold/main/avmmakefile" -o avmmakefile) + +$(shell curl -H 'Cache-Control: no-cache, no-store' -sSL "https://raw.githubusercontent.com/Azure/tfmod-scaffold/main/avmmakefile" -o avmmakefile) + -include avmmakefile \ No newline at end of file diff --git a/SUPPORT.md b/SUPPORT.md index a7b328d..8fbaa5e 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -6,7 +6,7 @@ This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue. -Issues can be created and searched through for existing [issues here](https://github.com//issues). +Issues can be created and searched through for existing [issues here](https://github.com/Azure/terraform-azurerm-avm-res-network-firewall/issues). Please provide as much information as possible when filing an issue. Include screenshots or correlation IDs if possible (please redact any sensitive information). diff --git a/avm b/avm new file mode 100755 index 0000000..3d83518 --- /dev/null +++ b/avm @@ -0,0 +1,21 @@ +#!/usr/bin/env sh + +usage () { + echo "Usage: avm " +} + +CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-docker} + +if [ ! "$(command -v "$CONTAINER_RUNTIME")" ]; then + echo "Error: $CONTAINER_RUNTIME is not installed. Please install $CONTAINER_RUNTIME first." + exit 1 +fi + +if [ -z "$1" ]; then + echo "Error: Please provide a make target. See https://github.com/Azure/tfmod-scaffold/blob/main/avmmakefile for available targets." + echo + usage + exit 1 +fi + +$CONTAINER_RUNTIME run --pull always --rm -v "$(pwd)":/src -w /src mcr.microsoft.com/azterraform make "$1" diff --git a/avm.bat b/avm.bat new file mode 100644 index 0000000..3667232 --- /dev/null +++ b/avm.bat @@ -0,0 +1,23 @@ +@echo off +SETLOCAL + +REM Set CONTAINER_RUNTIME to its current value if it's already set, or docker if it's not +IF DEFINED CONTAINER_RUNTIME (SET "CONTAINER_RUNTIME=%CONTAINER_RUNTIME%") ELSE (SET "CONTAINER_RUNTIME=docker") + +REM Check if CONTAINER_RUNTIME is installed +WHERE /Q %CONTAINER_RUNTIME% +IF ERRORLEVEL 1 ( + echo Error: %CONTAINER_RUNTIME% is not installed. Please install %CONTAINER_RUNTIME% first. + exit /b +) + +REM Check if a make target is provided +IF "%~1"=="" ( + echo Error: Please provide a make target. See https://github.com/Azure/tfmod-scaffold/blob/main/avmmakefile for available targets. + exit /b +) + +REM Run the make target with CONTAINER_RUNTIME +%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src mcr.microsoft.com/azterraform make %1 + +ENDLOCAL diff --git a/examples/.terraform-docs.yml b/examples/.terraform-docs.yml index 5bc8671..f97f3a3 100644 --- a/examples/.terraform-docs.yml +++ b/examples/.terraform-docs.yml @@ -4,7 +4,7 @@ formatter: "markdown document" # this is required -version: "0.16.0" +version: "~> 0.17.0" header-from: "_header.md" footer-from: "_footer.md"