diff --git a/.github/workflows/update-tooling.yml b/.github/workflows/update-tooling.yml index 9681378790dd..25b737f40384 100644 --- a/.github/workflows/update-tooling.yml +++ b/.github/workflows/update-tooling.yml @@ -15,6 +15,7 @@ env: KPT_URL: "https://api.github.com/repos/kptdev/kpt/releases" CFT_CLI_URL: "https://api.github.com/repos/GoogleCloudPlatform/cloud-foundation-toolkit/releases" MODULE_SWAPPER_URL: "https://api.github.com/repos/GoogleCloudPlatform/cloud-foundation-toolkit/releases" + TFLINT_BP_PLUGIN_URL: "https://api.github.com/repos/GoogleCloudPlatform/cloud-foundation-toolkit/releases" KUBECTL_MINOR: "1.28" KUBECTL_URL: "https://api.github.com/repos/kubernetes/kubernetes/releases" GATOR_MINOR: "3.14" @@ -38,7 +39,7 @@ jobs: run: | PR_UPDATE_BODY="" newline=$'\n' - tools=("TERRAFORM" "CLOUD_SDK" "CFT_CLI" "KUBECTL" "GATOR" "GCRANE" "KPT" "MODULE_SWAPPER" "KUSTOMIZE" "TERRAGRUNT" "TFLINT" "GOLANGCI") + tools=("TERRAFORM" "CLOUD_SDK" "CFT_CLI" "KUBECTL" "GATOR" "GCRANE" "KPT" "MODULE_SWAPPER" "KUSTOMIZE" "TERRAGRUNT" "TFLINT" "GOLANGCI" "TFLINT_BP_PLUGIN") for tool in ${tools[@]} do @@ -58,6 +59,9 @@ jobs: elif [ "$tool" == "MODULE_SWAPPER" ]; then # get latest MODULE_SWAPPER release LATEST_TOOL_VERSION=$(curl -s ${!TOOL_URL} | jq --raw-output '[ .[] | select( .name | contains("infra/module-swapper"))][0].tag_name' | tr -d "infra/module\-swapper/v") + elif [ "$tool" == "TFLINT_BP_PLUGIN" ]; then + # get latest TFLINT_BP_PLUGIN release + LATEST_TOOL_VERSION=$(curl -s ${!TOOL_URL} | jq --raw-output '[ .[] | select( .name | contains("tflint-ruleset-blueprint"))][0].tag_name' | tr -d "tflint\-ruleset\-blueprint/v") elif [ "$tool" == "KUBECTL" ]; then # get latest KUBECTL_MINOR release LATEST_TOOL_VERSION=$(curl -s ${!TOOL_URL} | jq --raw-output '[ .[] | select( .name | contains("'${KUBECTL_MINOR}'"))][0].tag_name' | tr -d "v") diff --git a/infra/build/Makefile b/infra/build/Makefile index a6f32bb1baff..f27672440475 100644 --- a/infra/build/Makefile +++ b/infra/build/Makefile @@ -44,7 +44,8 @@ TINKEY_VERSION := 1.7.0 ALPINE_VERSION := 3.20 # Updated by Update Tooling Workflow MODULE_SWAPPER_VERSION := 0.4.8 -TFLINT_BP_PLUGIN := 0.1.0 +# Updated by Update Tooling Workflow +TFLINT_BP_PLUGIN_VERSION := 0.1.0 # For developer-tools-krm # Updated by Update Tooling Workflow @@ -93,7 +94,7 @@ build-image-developer-tools: --build-arg TINKEY_VERSION=${TINKEY_VERSION} \ --build-arg ALPINE_VERSION=${ALPINE_VERSION} \ --build-arg MODULE_SWAPPER_VERSION=${MODULE_SWAPPER_VERSION} \ - --build-arg TFLINT_BP_PLUGIN=${TFLINT_BP_PLUGIN} \ + --build-arg TFLINT_BP_PLUGIN_VERSION=${TFLINT_BP_PLUGIN_VERSION} \ -t ${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} "./developer-tools" docker build \ --build-arg BASE_IMAGE_VERSION=${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \ diff --git a/infra/build/developer-tools/Dockerfile b/infra/build/developer-tools/Dockerfile index 940ce257154b..989824917444 100644 --- a/infra/build/developer-tools/Dockerfile +++ b/infra/build/developer-tools/Dockerfile @@ -115,8 +115,8 @@ RUN /build/install_kubectl.sh ${KUBECTL_VERSION} ARG MODULE_SWAPPER_VERSION RUN /build/install_module-swapper.sh ${MODULE_SWAPPER_VERSION} -ARG TFLINT_BP_PLUGIN -RUN /build/install_tflint_plugin.sh ${TFLINT_BP_PLUGIN} +ARG TFLINT_BP_PLUGIN_VERSION +RUN /build/install_tflint_plugin.sh ${TFLINT_BP_PLUGIN_VERSION} WORKDIR /opt/kitchen ADD ./build/data/Gemfile . diff --git a/infra/build/developer-tools/build/install_tflint_plugin.sh b/infra/build/developer-tools/build/install_tflint_plugin.sh index 65db2b99b00f..9b29ca6c8aa8 100755 --- a/infra/build/developer-tools/build/install_tflint_plugin.sh +++ b/infra/build/developer-tools/build/install_tflint_plugin.sh @@ -19,8 +19,8 @@ set -u mkdir -p /build/install_tflint_plugin cd /build/install_tflint_plugin -TFLINT_BP_PLUGIN=$1 -wget -nv "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/releases/download/tflint-ruleset-blueprint%2Fv${TFLINT_BP_PLUGIN}/tflint-ruleset-blueprint_linux_amd64.zip" +TFLINT_BP_PLUGIN_VERSION=$1 +wget -nv "https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/releases/download/tflint-ruleset-blueprint%2Fv${TFLINT_BP_PLUGIN_VERSION}/tflint-ruleset-blueprint_linux_amd64.zip" unzip -q tflint-ruleset-blueprint_linux_amd64.zip mkdir -p ~/.tflint.d/plugins install -o 0 -g 0 -m 0755 tflint-ruleset-blueprint ~/.tflint.d/plugins