Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ updates:
reviewers:
- mrrobot47

- package-ecosystem: "docker"
directory: "/compat-scanner"
schedule:
interval: "weekly"
reviewers:
- mrrobot47

- package-ecosystem: "docker"
directory: "/cron"
schedule:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
strategy:
fail-fast: false
matrix:
others: ['nginx', 'nginx-proxy', 'postfix', 'redis', 'cron', 'mailhog', 'mariadb', 'newrelic-daemon']
others: ['nginx', 'nginx-proxy', 'postfix', 'redis', 'cron', 'mailhog', 'mariadb', 'newrelic-daemon', 'compat-scanner']
steps:
- name: Checkout
uses: actions/checkout@v7
Expand All @@ -101,8 +101,13 @@ jobs:
if: github.event_name == 'pull_request'
with:
context: ${{ matrix.others }}
load: ${{ matrix.others == 'compat-scanner' }}
tags: easyengine/${{ matrix.others }}:test

- name: Test compat-scanner image
if: github.event_name == 'pull_request' && matrix.others == 'compat-scanner'
run: bash compat-scanner/tests/run.sh easyengine/compat-scanner:test

- name: Build and push ${{ matrix.others }} image
uses: docker/build-push-action@v7
if: github.event_name != 'pull_request'
Expand Down
29 changes: 29 additions & 0 deletions compat-scanner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM composer:2.10.3 AS composer

WORKDIR /opt/compat-scanner
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-interaction --no-progress --no-cache --optimize-autoloader

# Calibration sample for estimate mode: ~1 MiB of WordPress core from a pinned, checksummed release.
ARG WP_VERSION=7.1.4
ARG WP_SHA256=881e53a4681ff2cd911651b11cccdede5ae477ddf0765af5d6a1a8b219a1d835
COPY calibration/select.php /tmp/select.php
RUN set -eux; \
wget -q -O /tmp/wp.tar.gz "https://wordpress.org/wordpress-${WP_VERSION}.tar.gz"; \
echo "${WP_SHA256} /tmp/wp.tar.gz" | sha256sum -c -; \
tar -xzf /tmp/wp.tar.gz -C /tmp wordpress/wp-includes; \
php /tmp/select.php /tmp/wordpress/wp-includes /opt/compat-scanner/calibration; \
rm -rf /tmp/wp.tar.gz /tmp/wordpress /tmp/select.php

FROM php:8.4-cli-alpine

LABEL org.label-schema.schema-version="1.0.0"
LABEL org.label-schema.vendor="EasyEngine"
LABEL org.label-schema.name="compat-scanner"

COPY --from=composer /opt/compat-scanner /opt/compat-scanner
COPY bin/ /opt/compat-scanner/bin/
COPY src/ /opt/compat-scanner/src/

USER 33:33
ENTRYPOINT ["php", "-d", "memory_limit=256M", "-d", "display_errors=stderr", "/opt/compat-scanner/bin/compat-scanner.php"]
Loading