Skip to content

Commit

Permalink
Use fixed version of imagick, update soms deps
Browse files Browse the repository at this point in the history
  • Loading branch information
wslaghekke committed Mar 18, 2024
1 parent 4f23656 commit 6468182
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 127 deletions.
12 changes: 6 additions & 6 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& mkdir /var/www/html/public

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

ARG ENABLE_IMAGE_SUPPORT=false
RUN if [ "$ENABLE_IMAGE_SUPPORT" = true ]; then apt-get update \
&& apt-get install -y libvips-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& MAKE="make -j$(nproc)" pecl install vips imagick \
# We use a specific commit for imagick because php8.3 is not supported by the latest released version (3.7.0)
RUN if [ "$ENABLE_IMAGE_SUPPORT" = true ]; then install-php-extensions vips \
&& install-php-extensions Imagick/imagick@7088edc353f53c4bc644573a79cdcd67a726ae16 \
&& docker-php-ext-enable vips imagick; \
else echo "Image support is disabled"; fi
else echo "Image support is disabled"; fi \

ARG ENABLE_DEBUG=false
RUN if [ "$ENABLE_DEBUG" = true ]; then pecl install -f xdebug \
Expand Down
11 changes: 5 additions & 6 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ RUN pecl install apcu \
&& pecl clear-cache \
&& echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini


# Upload settings
RUN echo "file_uploads = On\n" \
"memory_limit = 256M\n" \
Expand All @@ -54,12 +53,12 @@ RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& mkdir /var/www/html/public

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

ARG ENABLE_IMAGE_SUPPORT=false
RUN if [ "$ENABLE_IMAGE_SUPPORT" = true ]; then apt-get update \
&& apt-get install -y libvips-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& MAKE="make -j$(nproc)" pecl install vips imagick \
# We use a specific commit for imagick because php8.3 is not supported by the latest released version (3.7.0)
RUN if [ "$ENABLE_IMAGE_SUPPORT" = true ]; then install-php-extensions vips \
&& install-php-extensions Imagick/imagick@7088edc353f53c4bc644573a79cdcd67a726ae16 \
&& docker-php-ext-enable vips imagick; \
else echo "Image support is disabled"; fi

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"start": "ts-node src/index.ts"
},
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@types/dockerode": "^3.2.2",
"@types/node": "^14.14.31",
"axios": "^0.21.1",
"@types/node": "^20.0",
"axios": "^1.6.8",
"compare-versions": "^3.5.1",
"docker-registry-client": "^3.3.0",
"dockerode": "^3.2.1",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {createClientV2} from 'docker-registry-client';

(async () => {
try {
const phpRegex = new RegExp(process.argv[2] || '^(?:(7\\.[1-9])|([8-9]\\.\\d+))-(apache|fpm)$');
const phpRegex = new RegExp(process.argv[2] || '^([89]\\.\\d)(\\.\\d+)?-(apache|fpm)$');
const client = createClientV2({'name': 'php'});
const phpVersions: PhpVersion[] = (await getTags(client)).tags.map(it => {
const match = phpRegex.exec(it);
Expand Down Expand Up @@ -45,7 +45,7 @@ async function createOrUpdateRelease(phpVersion: PhpVersion, imageTags: string[]

const target_commitish = getInput('commitish', { required: false }) || context.sha;
const tag = `php${phpVersion.version}`
const existingRelease = await octokit.repos.getReleaseByTag({owner, repo, tag}).then(response => response.data).catch(err => {
const existingRelease = await octokit.rest.repos.getReleaseByTag({owner, repo, tag}).then(response => response.data).catch(err => {
if (err?.status === 404) {
return null
}
Expand All @@ -55,7 +55,7 @@ async function createOrUpdateRelease(phpVersion: PhpVersion, imageTags: string[]
const body = `Available tags for \`${tag}\`:\n\n` + imageTags.join('\n')

if (existingRelease === null) {
octokit.repos.createRelease({
octokit.rest.repos.createRelease({
owner,
repo,
tag_name: tag,
Expand All @@ -64,7 +64,7 @@ async function createOrUpdateRelease(phpVersion: PhpVersion, imageTags: string[]
body
})
} else {
octokit.repos.updateRelease({
octokit.rest.repos.updateRelease({
owner,
repo,
tag_name: tag,
Expand Down
Loading

0 comments on commit 6468182

Please sign in to comment.