From 4bf1383892e4d84b3ddbc48b35465b1dce6ddb38 Mon Sep 17 00:00:00 2001 From: Fred Cox Date: Fri, 24 May 2024 09:47:02 +0100 Subject: [PATCH] chore: clean up old image builds --- .github/workflows/release-image.yml | 15 +++++++-------- 1/Dockerfile | 9 --------- 2.19/Dockerfile | 9 --------- 2/Dockerfile | 9 --------- 3.12/Dockerfile | 9 --------- 3.13/Dockerfile | 9 --------- Dockerfile.template | 7 ------- README.md | 24 ++++++++++++++++-------- update.sh | 18 ------------------ 9 files changed, 23 insertions(+), 86 deletions(-) delete mode 100644 1/Dockerfile delete mode 100644 2.19/Dockerfile delete mode 100644 2/Dockerfile delete mode 100644 3.12/Dockerfile delete mode 100644 3.13/Dockerfile diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml index 004b646..c411038 100644 --- a/.github/workflows/release-image.yml +++ b/.github/workflows/release-image.yml @@ -5,7 +5,7 @@ name: Create and publish a Docker image on: push: - branches: ['*'] + branches: ["*"] pull_request: jobs: @@ -15,7 +15,7 @@ jobs: contents: read steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check update has been run run: | @@ -29,7 +29,7 @@ jobs: container: hadolint/hadolint:latest-debian steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check hadolint run: | @@ -42,7 +42,7 @@ jobs: container: mvdan/shfmt:latest-alpine steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check shfmt run: | @@ -55,7 +55,7 @@ jobs: container: koalaman/shellcheck-alpine:latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check shellcheck run: | @@ -68,12 +68,11 @@ jobs: packages: write strategy: matrix: - # Update only v3 images without touching older ones to better manage back-compatibility - version: ['3.12', '3.13', '3.57', '3'] + version: ["3.57", "3"] needs: [checks-hadolint, checks-shfmt, checks-shellcheck, checks-update] steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/1/Dockerfile b/1/Dockerfile deleted file mode 100644 index 54cd74d..0000000 --- a/1/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM php:7.1-alpine - -ENV PHP_CS_FIXER_VERSION 1.13.3 -# hadolint ignore=DL3018 -RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$PHP_CS_FIXER_VERSION/php-cs-fixer.phar -o php-cs-fixer \ - && chmod +x php-cs-fixer \ - && mv php-cs-fixer /usr/local/bin/php-cs-fixer - -CMD ["/usr/local/bin/php-cs-fixer", "fix"] diff --git a/2.19/Dockerfile b/2.19/Dockerfile deleted file mode 100644 index 1f40193..0000000 --- a/2.19/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM php:8.0-alpine - -ENV PHP_CS_FIXER_VERSION 2.19.3 -# hadolint ignore=DL3018 -RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$PHP_CS_FIXER_VERSION/php-cs-fixer.phar -o php-cs-fixer \ - && chmod +x php-cs-fixer \ - && mv php-cs-fixer /usr/local/bin/php-cs-fixer - -CMD ["/usr/local/bin/php-cs-fixer", "fix"] diff --git a/2/Dockerfile b/2/Dockerfile deleted file mode 100644 index 1f40193..0000000 --- a/2/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM php:8.0-alpine - -ENV PHP_CS_FIXER_VERSION 2.19.3 -# hadolint ignore=DL3018 -RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$PHP_CS_FIXER_VERSION/php-cs-fixer.phar -o php-cs-fixer \ - && chmod +x php-cs-fixer \ - && mv php-cs-fixer /usr/local/bin/php-cs-fixer - -CMD ["/usr/local/bin/php-cs-fixer", "fix"] diff --git a/3.12/Dockerfile b/3.12/Dockerfile deleted file mode 100644 index ceaa787..0000000 --- a/3.12/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM php:8.1-alpine - -ENV PHP_CS_FIXER_VERSION 3.12.0 -# hadolint ignore=DL3018 -RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$PHP_CS_FIXER_VERSION/php-cs-fixer.phar -o php-cs-fixer \ - && chmod +x php-cs-fixer \ - && mv php-cs-fixer /usr/local/bin/php-cs-fixer - -CMD ["/usr/local/bin/php-cs-fixer", "fix"] diff --git a/3.13/Dockerfile b/3.13/Dockerfile deleted file mode 100644 index 0879a75..0000000 --- a/3.13/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM php:8.1-alpine - -ENV PHP_CS_FIXER_VERSION 3.13.2 -# hadolint ignore=DL3018 -RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$PHP_CS_FIXER_VERSION/php-cs-fixer.phar -o php-cs-fixer \ - && chmod +x php-cs-fixer \ - && mv php-cs-fixer /usr/local/bin/php-cs-fixer - -CMD ["/usr/local/bin/php-cs-fixer", "fix"] diff --git a/Dockerfile.template b/Dockerfile.template index 1e503c0..964789b 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -3,13 +3,6 @@ FROM php:%%PHP_VERSION%%-alpine ENV PHP_CS_FIXER_VERSION %%VARIANT%% # hadolint ignore=DL3018 RUN curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$PHP_CS_FIXER_VERSION/php-cs-fixer.phar -o php-cs-fixer \ -#### - && curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$PHP_CS_FIXER_VERSION/php-cs-fixer.phar.asc -o php-cs-fixer.phar.asc \ - && apk add --no-cache --virtual .build-deps gnupg \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-key BBAB5DF0A0D6672989CF1869E82B2FB314E9906E \ - && gpg --verify php-cs-fixer.phar.asc php-cs-fixer \ - && apk del .build-deps \ -#### && chmod +x php-cs-fixer \ && mv php-cs-fixer /usr/local/bin/php-cs-fixer diff --git a/README.md b/README.md index 23c5e5d..8250e6a 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,25 @@ Image used for running cs fixer on our ci server ## Tags available -* `3.13`, `3` `latest` -* `3.12` -* `3.9` -* `3.8` -* `2.19`, `2` -* `1` +- `3.57`, `3` `latest` + +## Unmaintained tags + +- `3.13` +- `3.12` +- `3.9` +- `3.8` +- `2.19`, `2` +- `1` ## Build command - docker build -t ekreative/php-cs-fixer . +```shell +docker build -t ekreative/php-cs-fixer . +``` ## Build an app - docker run -ti --rm --volume=$(pwd):/srv -w /srv ekreative/php-cs-fixer +```shell +docker run -ti --rm --volume=$(pwd):/srv -w /srv ekreative/php-cs-fixer +``` diff --git a/update.sh b/update.sh index b221774..d424f2f 100755 --- a/update.sh +++ b/update.sh @@ -5,23 +5,11 @@ set -e declare -A variants=( ['3']='3.57.2' ['3.57']='3.57.2' - ['3.13']='3.13.2' - ['3.12']='3.12.0' - # Don't rebuild old images - # ['2']='2.19.3' - # ['2.19']='2.19.3' - # ['1']='1.13.3' ) declare -A php_version=( ['3']='8.3' ['3.57']='8.3' - ['3.13']='8.1' - ['3.12']='8.1' - # Don't rebuild old images - # ['2']='8.0' - # ['2.19']='8.0' - # ['1']='7.1' ) for variant in "${!variants[@]}"; do @@ -31,12 +19,6 @@ for variant in "${!variants[@]}"; do mkdir -p "$dir" extraSed='' - # if [ "$variant" = "1" ]; then - extraSed=' - '"$extraSed"' - /####/,/##<\/verify>##/d; - ' - # fi sed -E ' '"$extraSed"' s/%%VARIANT%%/'"${variants[$variant]}"'/;