diff --git a/CHANGELOG.md b/CHANGELOG.md index ea38ffa524e..4cc64ba5ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Free disk space earlier in the process to avoid failure during docker build - Set flavors-stats.json as a generated file in .gitattributes ([#3023](https://github.com/oxsecurity/megalinter/pull/3023)) - Update and fix our ChatOps automations to only run on pull request comments, by @echoix in [#3034](https://github.com/oxsecurity/megalinter/pull/3034) + - Use App::cpm to install perlcritic faster, and clean `.perl-cpm` cache, by @echoix in [#3036](https://github.com/oxsecurity/megalinter/pull/3036) - Add failure message in ChatOps build-command and Slash dispatcher, by @echoix in [#3037](https://github.com/oxsecurity/megalinter/pull/3037) - Linter versions upgrades diff --git a/Dockerfile b/Dockerfile index 6c4adaddd48..21ea00283ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -626,7 +626,9 @@ RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${P # Managed with COPY --link --from=checkmake /checkmake /usr/bin/checkmake # perlcritic installation - && curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic + && curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g --show-build-log-on-failure --without-build --without-test --without-runtime Perl::Critic \ + && rm -rf /root/.perl-cpm + # phpcs installation RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install phpcs -g --trust-gpg-keys 31C7E470E2138192 diff --git a/linters/perl_perlcritic/Dockerfile b/linters/perl_perlcritic/Dockerfile index 8612f02653d..d15ba2a4c9b 100644 --- a/linters/perl_perlcritic/Dockerfile +++ b/linters/perl_perlcritic/Dockerfile @@ -124,7 +124,9 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ ############################################################################################# #OTHER__START # perlcritic installation -RUN curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic +RUN curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g --show-build-log-on-failure --without-build --without-test --without-runtime Perl::Critic \ + && rm -rf /root/.perl-cpm + #OTHER__END diff --git a/megalinter/descriptors/perl.megalinter-descriptor.yml b/megalinter/descriptors/perl.megalinter-descriptor.yml index 027f3dba693..4db3acc5ef1 100644 --- a/megalinter/descriptors/perl.megalinter-descriptor.yml +++ b/megalinter/descriptors/perl.megalinter-descriptor.yml @@ -31,4 +31,6 @@ linters: - "perlcritic myfile.pl" install: dockerfile: - - RUN curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic + - | + RUN curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm | perl - install -g --show-build-log-on-failure --without-build --without-test --without-runtime Perl::Critic \ + && rm -rf /root/.perl-cpm