diff --git a/Dockerfile b/Dockerfile index a35bfed58a9..aa725f74c52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -326,7 +326,9 @@ ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk ENV PATH="$JAVA_HOME/bin:${PATH}" # PHP installation -RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" \ + && export GITHUB_AUTH_TOKEN \ + && wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ && wget --tries=5 -q -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ && PHAR_KEY_ID="0x9D8A98B29B2D5D79" \ && ( gpg --keyserver keyserver.pgp.com --recv-keys "$PHAR_KEY_ID" \ @@ -508,19 +510,22 @@ RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${P && chmod 755 /usr/local/bin/checkmake \ # perlcritic installation - && curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic \ + && curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic # phpcs installation - && phive --no-progress install phpcs -g --trust-gpg-keys 31C7E470E2138192 \ +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 + # phpstan installation - && phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720 \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720 + # psalm installation - && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 + # phplint installation - && composer global require --ignore-platform-reqs overtrue/phplint ^5.3 \ +RUN composer global require --ignore-platform-reqs overtrue/phplint ^5.3 \ && composer global config bin-dir --absolute \ # powershell installation diff --git a/flavors/cupcake/Dockerfile b/flavors/cupcake/Dockerfile index 71184912ae7..90e08a4dc0b 100644 --- a/flavors/cupcake/Dockerfile +++ b/flavors/cupcake/Dockerfile @@ -265,7 +265,9 @@ ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk ENV PATH="$JAVA_HOME/bin:${PATH}" # PHP installation -RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" \ + && export GITHUB_AUTH_TOKEN \ + && wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ && wget --tries=5 -q -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ && PHAR_KEY_ID="0x9D8A98B29B2D5D79" \ && ( gpg --keyserver keyserver.pgp.com --recv-keys "$PHAR_KEY_ID" \ @@ -363,19 +365,23 @@ RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${P # checkmake installation && ( [ -d /usr/local/bin ] || mkdir -p /usr/local/bin ) \ && wget -q "https://github.com/mrtazz/checkmake/releases/download/0.2.1/checkmake-0.2.1.linux.amd64" -O /usr/local/bin/checkmake \ - && chmod 755 /usr/local/bin/checkmake \ + && chmod 755 /usr/local/bin/checkmake + # phpcs installation - && phive --no-progress install phpcs -g --trust-gpg-keys 31C7E470E2138192 \ +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 + # phpstan installation - && phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720 \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720 + # psalm installation - && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 + # phplint installation - && composer global require --ignore-platform-reqs overtrue/phplint ^5.3 \ +RUN composer global require --ignore-platform-reqs overtrue/phplint ^5.3 \ && composer global config bin-dir --absolute \ # gitleaks installation diff --git a/flavors/php/Dockerfile b/flavors/php/Dockerfile index 3b399b1662c..520f0c96300 100644 --- a/flavors/php/Dockerfile +++ b/flavors/php/Dockerfile @@ -215,7 +215,9 @@ COPY --from=gitleaks /usr/bin/gitleaks /usr/bin/ ############################################################################################# #OTHER__START # PHP installation -RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" \ + && export GITHUB_AUTH_TOKEN \ + && wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ && wget --tries=5 -q -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ && PHAR_KEY_ID="0x9D8A98B29B2D5D79" \ && ( gpg --keyserver keyserver.pgp.com --recv-keys "$PHAR_KEY_ID" \ @@ -279,19 +281,23 @@ RUN go install github.com/rhysd/actionlint/cmd/actionlint@latest && go clean --c && tar xf ${ML_THIRD_PARTY_DIR}/kubeconform-linux-amd64.tar.gz --directory ${ML_THIRD_PARTY_DIR} \ && mv ${ML_THIRD_PARTY_DIR}/kubeconform /usr/local/bin \ && rm ${ML_THIRD_PARTY_DIR}/kubeconform-linux-amd64.tar.gz \ - && find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete \ + && find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete + # phpcs installation - && phive --no-progress install phpcs -g --trust-gpg-keys 31C7E470E2138192 \ +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 + # phpstan installation - && phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720 \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720 + # psalm installation - && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 + # phplint installation - && composer global require --ignore-platform-reqs overtrue/phplint ^5.3 \ +RUN composer global require --ignore-platform-reqs overtrue/phplint ^5.3 \ && composer global config bin-dir --absolute \ # protolint installation diff --git a/linters/php_psalm/Dockerfile b/linters/php_psalm/Dockerfile index f4256c45e14..615a9c4032d 100644 --- a/linters/php_psalm/Dockerfile +++ b/linters/php_psalm/Dockerfile @@ -134,7 +134,9 @@ ENV PATH="/node-deps/node_modules/.bin:${PATH}" \ ############################################################################################# #OTHER__START # PHP installation -RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" \ + && export GITHUB_AUTH_TOKEN \ + && wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ && wget --tries=5 -q -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ && PHAR_KEY_ID="0x9D8A98B29B2D5D79" \ && ( gpg --keyserver keyserver.pgp.com --recv-keys "$PHAR_KEY_ID" \ @@ -150,7 +152,7 @@ RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ ENV PATH="/root/.composer/vendor/bin:$PATH" # psalm installation -RUN phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 +RUN --mount=type=secret,id=GITHUB_TOKEN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 #OTHER__END diff --git a/megalinter/descriptors/php.megalinter-descriptor.yml b/megalinter/descriptors/php.megalinter-descriptor.yml index 6364bfd0c45..97618a1559c 100644 --- a/megalinter/descriptors/php.megalinter-descriptor.yml +++ b/megalinter/descriptors/php.megalinter-descriptor.yml @@ -21,7 +21,9 @@ install: - dpkg dockerfile: - | - RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ + RUN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" \ + && export GITHUB_AUTH_TOKEN \ + && wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \ && wget --tries=5 -q -O phive.phar.asc https://phar.io/releases/phive.phar.asc \ && PHAR_KEY_ID="0x9D8A98B29B2D5D79" \ && ( gpg --keyserver keyserver.pgp.com --recv-keys "$PHAR_KEY_ID" \ @@ -52,7 +54,7 @@ linters: install: dockerfile: - | - RUN phive --no-progress install phpcs -g --trust-gpg-keys 31C7E470E2138192 + RUN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install phpcs -g --trust-gpg-keys 31C7E470E2138192 ide: atom: - name: linter-phpcs @@ -96,7 +98,7 @@ linters: install: dockerfile: - | - RUN phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720 + RUN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install phpstan -g --trust-gpg-keys CF1A108D0E7AE720 ide: idea: - name: PHPStan / Psalm / Generics @@ -130,7 +132,7 @@ linters: install: dockerfile: - | - RUN phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 + RUN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install psalm -g --trust-gpg-keys 8A03EA3B385DBAA1,12CE0F1D262429A5 ide: idea: - name: PHPStan / Psalm / Generics