Skip to content

Commit

Permalink
chore: clean up old image builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfedr committed May 24, 2024
1 parent a31cbba commit 4bf1383
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 86 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/release-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Create and publish a Docker image

on:
push:
branches: ['*']
branches: ["*"]
pull_request:

jobs:
Expand All @@ -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: |
Expand All @@ -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: |
Expand All @@ -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: |
Expand All @@ -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: |
Expand All @@ -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
Expand Down
9 changes: 0 additions & 9 deletions 1/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions 2.19/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions 2/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions 3.12/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions 3.13/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
##<verify>##
&& 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 \
##</verify>##
&& chmod +x php-cs-fixer \
&& mv php-cs-fixer /usr/local/bin/php-cs-fixer

Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
18 changes: 0 additions & 18 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,12 +19,6 @@ for variant in "${!variants[@]}"; do
mkdir -p "$dir"

extraSed=''
# if [ "$variant" = "1" ]; then
extraSed='
'"$extraSed"'
/##<verify>##/,/##<\/verify>##/d;
'
# fi
sed -E '
'"$extraSed"'
s/%%VARIANT%%/'"${variants[$variant]}"'/;
Expand Down

0 comments on commit 4bf1383

Please sign in to comment.