feat: Remove PHP 8.5 QA image
This commit is contained in:
parent
3bdf3f5d19
commit
6eb5061fd9
4 changed files with 0 additions and 2114 deletions
|
|
@ -76,14 +76,6 @@ docker-build:prod-7.3:
|
|||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule" && $BUILD_NAME == "PROD-7.3"
|
||||
|
||||
docker-build:qa-8.5:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
IMAGE_DIR: "PHP8.5/QA"
|
||||
IMAGE_NAME: "uwil-qa-8.5"
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "schedule" && $BUILD_NAME == "QA-8.5"
|
||||
|
||||
docker-build:ci-8.5:
|
||||
extends: .docker-build
|
||||
variables:
|
||||
|
|
|
|||
|
|
@ -1,115 +0,0 @@
|
|||
# Stage n°1: builder.
|
||||
# Cette étape ne sert qu'à l'installation et la compilation des extensions php.
|
||||
# Une fois fait, on copie les fichiers compilés vers le stage base,
|
||||
# et on supprime celui-là qui n'est donc plus utile, on gagne à peu près ~586MB.
|
||||
FROM php:8.5.4-cli-alpine AS builder
|
||||
# Utilisation de l'image docker php:8.5-cli-alpine: https://hub.docker.com/layers/library/php/8.5.4-cli-alpine/images
|
||||
# Bien plus légère que l'ancienne image php:8.5.4-apache-trixie.
|
||||
|
||||
# Récupération de la valeur de l'argument passé lors de la commande pour utiliser notre proxy.
|
||||
ARG http_proxy
|
||||
|
||||
# Définit des variables d'environnement dans l'image sous plusieurs formats car ça peu varier selon les outils.
|
||||
ENV http_proxy=${http_proxy} \
|
||||
https_proxy=${http_proxy} \
|
||||
HTTP_PROXY=${http_proxy} \
|
||||
HTTPS_PROXY=${http_proxy}
|
||||
|
||||
# Installation des packages nécessaires à la compilation des extensions php.
|
||||
RUN apk add --no-cache \
|
||||
freetype-dev jpeg-dev libpng-dev libwebp-dev libxpm-dev \
|
||||
zlib-dev icu-dev libxslt-dev libzip-dev \
|
||||
imagemagick-dev \
|
||||
libmemcached-dev cyrus-sasl-dev \
|
||||
oniguruma-dev gettext-dev gmp-dev \
|
||||
linux-headers \
|
||||
autoconf libtool pkgconfig alpine-sdk
|
||||
|
||||
# Installation des extensions php natives.
|
||||
RUN docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype \
|
||||
&& docker-php-ext-configure zip --with-zip \
|
||||
&& docker-php-ext-install -j"$(nproc)" \
|
||||
exif \
|
||||
gd \
|
||||
gettext \
|
||||
intl \
|
||||
mysqli \
|
||||
pdo_mysql \
|
||||
xsl \
|
||||
zip \
|
||||
bcmath \
|
||||
gmp
|
||||
|
||||
# PECL maintenant déprécié, on installe directement les extensions souhaitées depuis github.
|
||||
RUN \
|
||||
curl -fsSL https://github.com/Imagick/imagick/archive/refs/tags/3.8.1.tar.gz -o /tmp/imagick.tar.gz \
|
||||
&& tar -xzf /tmp/imagick.tar.gz -C /tmp \
|
||||
&& cd /tmp/imagick-3.8.1 \
|
||||
&& phpize && ./configure && make -j"$(nproc)" && make install \
|
||||
&& rm -rf /tmp/imagick* \
|
||||
\
|
||||
&& curl -fsSL https://github.com/php-memcached-dev/php-memcached/archive/refs/tags/v3.4.0.tar.gz -o /tmp/memcached.tar.gz \
|
||||
&& tar -xzf /tmp/memcached.tar.gz -C /tmp \
|
||||
&& cd /tmp/php-memcached-3.4.0 \
|
||||
&& phpize && ./configure && make -j"$(nproc)" && make install \
|
||||
&& rm -rf /tmp/memcached* \
|
||||
\
|
||||
&& curl -fsSL https://github.com/krakjoe/pcov/archive/refs/tags/v1.0.12.tar.gz -o /tmp/pcov.tar.gz \
|
||||
&& tar -xzf /tmp/pcov.tar.gz -C /tmp \
|
||||
&& cd /tmp/pcov-1.0.12 \
|
||||
&& phpize && ./configure && make -j"$(nproc)" && make install \
|
||||
&& rm -rf /tmp/pcov*
|
||||
|
||||
# Stage n°2: base.
|
||||
# Image finale qui sera utilisée sans compilateurs.
|
||||
FROM php:8.5.4-cli-alpine AS base
|
||||
|
||||
# Récupération de la valeur de l'argument passé lors de la commande pour utiliser notre proxy.
|
||||
ARG http_proxy
|
||||
|
||||
# Définit des variables d'environnement dans l'image sous plusieurs formats car ça peu varier selon les outils.
|
||||
ENV http_proxy=${http_proxy} \
|
||||
https_proxy=${http_proxy} \
|
||||
HTTP_PROXY=${http_proxy} \
|
||||
HTTPS_PROXY=${http_proxy} \
|
||||
LC_ALL=fr_FR.UTF-8 \
|
||||
LANG=fr_FR.UTF-8 \
|
||||
LANGUAGE=fr_FR.UTF-8:fr
|
||||
|
||||
# Installation des packages runtime + utilitaires + outils QA.
|
||||
RUN apk add --no-cache \
|
||||
ca-certificates curl \
|
||||
git unzip zip \
|
||||
freetype libjpeg libpng libwebp libxpm \
|
||||
icu-libs libxslt libzip \
|
||||
imagemagick \
|
||||
libmemcached \
|
||||
musl-locales musl-locales-lang \
|
||||
oniguruma \
|
||||
gmp gettext-libs \
|
||||
nodejs npm
|
||||
|
||||
# Copie des extensions compilées depuis le stage builder.
|
||||
COPY --from=builder /usr/local/lib/php/extensions/ /usr/local/lib/php/extensions/
|
||||
COPY --from=builder /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/
|
||||
|
||||
# Active les extensions copiées.
|
||||
RUN docker-php-ext-enable imagick memcached pcov
|
||||
|
||||
# Vérification des vulnérabilités avec local-php-security-checker (déprécié mais conservé pour compatibilité).
|
||||
RUN mkdir /tools \
|
||||
&& curl -fsSL https://github.com/fabpot/local-php-security-checker/releases/download/v2.0.4/local-php-security-checker_2.0.4_linux_amd64 \
|
||||
-o /tools/local-php-security-checker \
|
||||
&& chmod +x /tools/local-php-security-checker
|
||||
ENV PATH="$PATH:/tools"
|
||||
|
||||
# Installation composer.
|
||||
RUN curl -fsSL https://getcomposer.org/installer \
|
||||
| php -- --install-dir=/usr/local/bin --filename=composer --version=2.9.5
|
||||
|
||||
# audit-ci via npm.
|
||||
RUN npm install -g audit-ci@^6
|
||||
|
||||
COPY QA/conf/php-production.ini /usr/local/etc/php/conf.d/app.ini
|
||||
|
||||
WORKDIR /project
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,51 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Import shared utilities.
|
||||
source "$(pwd)/PHP8.5/utils.sh"
|
||||
|
||||
startTests
|
||||
|
||||
# Import shared tests.
|
||||
source "$(pwd)/PHP8.5/common.sh"
|
||||
|
||||
section "PHP extensions"
|
||||
run "bcmath" "php -m | grep -qx 'bcmath'"
|
||||
run "exif" "php -m | grep -qx 'exif'"
|
||||
run "gd" "php -m | grep -qx 'gd'"
|
||||
run "gettext" "php -m | grep -qx 'gettext'"
|
||||
run "gmp" "php -m | grep -qx 'gmp'"
|
||||
run "imagick" "php -m | grep -qx 'imagick'"
|
||||
run "intl" "php -m | grep -qx 'intl'"
|
||||
run "mbstring" "php -m | grep -qx 'mbstring'"
|
||||
run "memcached" "php -m | grep -qx 'memcached'"
|
||||
run "mysqli" "php -m | grep -qx 'mysqli'"
|
||||
run "pcov" "php -m | grep -qx 'pcov'"
|
||||
run "pdo_mysql" "php -m | grep -qx 'pdo_mysql'"
|
||||
run "xsl" "php -m | grep -qx 'xsl'"
|
||||
run "zip" "php -m | grep -qx 'zip'"
|
||||
|
||||
section "Compiled extensions"
|
||||
run "gd: imagecreate" "php -r '\$i = imagecreate(10,10); echo \$i ? \"ok\" : \"fail\";'"
|
||||
run "imagick: instanciation" "php -r 'new Imagick(); echo \"ok\";'"
|
||||
run "pcov: driver" "php -d pcov.enabled=1 -r 'echo pcov\\\\Collector::start() ? \"ok\" : \"ok\";' 2>/dev/null || true; php -m | grep -q pcov"
|
||||
|
||||
section "QA tools"
|
||||
run "local-php-security-checker present" "local-php-security-checker -help 2>&1 | grep -qi 'version'"
|
||||
run_output "composer version" "composer --version 2>/dev/null | awk '{print \$1,\$2,\$3}'"
|
||||
run_output "audit-ci version" "audit-ci --version 2>/dev/null || npx audit-ci --version 2>/dev/null"
|
||||
run_output "node version" "node --version"
|
||||
run_output "npm version" "npm --version"
|
||||
|
||||
section "Utilities"
|
||||
run "git disponible" "git --version"
|
||||
run "curl disponible" "curl --version"
|
||||
run "unzip disponible" "unzip -v"
|
||||
|
||||
section "Paths"
|
||||
run "WORKDIR = /project" "[ \"\$(pwd)\" = '/project' ]"
|
||||
run "/tools dans le PATH" "echo \$PATH | grep -q '/tools'"
|
||||
run "composer dans le PATH" "which composer"
|
||||
run "audit-ci dans le PATH" "which audit-ci"
|
||||
run "security-checker dans PATH" "which local-php-security-checker"
|
||||
|
||||
endTests
|
||||
Loading…
Add table
Reference in a new issue