Skip to content

Commit

Permalink
chore(ZMS-3237): Switch php base image from Berlin to Munich (#704)
Browse files Browse the repository at this point in the history
* chore(ZMS-3237): Switch php base image from Berlin to Munich

* chore(ZMS-3237): Upgrade zmsclient to php 7.4

* chore(ZMS-3237): Upgrade zmsclient to php 8.0

* chore(ZMS-3237): Upgrade zmsclient to php 8.0 fix unit test

* chore(ZMS-3237): change old gitlab pipelines

* chore(ZMS-3237): cleanup old pipeline versions

* chore(ZMS-3237): cleanup old pipeline versions
  • Loading branch information
ThomasAFink authored Dec 4, 2024
1 parent bdd65cc commit e251db1
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 54 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
module-test:
runs-on: ubuntu-latest
container:
image: "registry.gitlab.com/eappointment/php-base:${{ matrix.php_version }}-dev"
image: "ghcr.io/it-at-m/eappointment-php-base:${{ matrix.php_version }}-dev"
steps:
- name: Checkout GitHub Action
uses: actions/checkout@main
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
zmsapi-test:
runs-on: ubuntu-latest
container:
image: "registry.gitlab.com/eappointment/php-base:8.0-dev"
image: "ghcr.io/it-at-m/eappointment-php-base:8.0-dev"
services:
mariadb:
image: mariadb:10.6
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
zmsdb-test:
runs-on: ubuntu-latest
container:
image: "registry.gitlab.com/eappointment/php-base:8.0-dev"
image: "ghcr.io/it-at-m/eappointment-php-base:8.0-dev"
services:
mariadb:
image: mariadb:10.6
Expand Down
5 changes: 2 additions & 3 deletions .resources/Containerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG PHP_VERSION
FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build
RUN useradd --shell /bin/bash --create-home build
COPY --chown=build:build . /build
ARG MODULE
Expand All @@ -8,8 +8,7 @@ USER build:build
RUN make live

ARG PHP_VERSION
FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base
RUN docker-apt-clean-install libfcgi-bin
ARG MODULE
COPY --from=build --chown=0:0 /build/${MODULE} /var/www/html

8 changes: 4 additions & 4 deletions zmsadmin/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include:
remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml

test-php-73:
test-php-80:
variables:
PHP_VERSION: 7.3
image: registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev
PHP_VERSION: 8.0
image: ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev
script:
- $CLI_COMPOSER
- $CLI_PHPCS
Expand All @@ -19,7 +19,7 @@ test-php-73:
- npm install --legacy-peer-deps
- make css
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
only:
changes:
- .gitlab-ci.yml
Expand Down
4 changes: 2 additions & 2 deletions zmsadmin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG PHP_VERSION
FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build
COPY --chown=1000:1000 . /build
WORKDIR /build
USER 1000:1000
RUN make live

FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base
COPY --from=build --chown=0:0 /build /var/www/html
12 changes: 6 additions & 6 deletions zmsapi/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ include:
.test-php-custom:
stage: test
variables:
PHP_VERSION: 7.3
image: registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev
PHP_VERSION: 8.0
image: ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev
cache:
key: "zmsbase"
paths:
Expand All @@ -25,7 +25,7 @@ include:
junit: public/_tests/junit.xml


test-php-73:
test-php-80:
extends: .test-php-custom
allow_failure: true
services:
Expand All @@ -38,7 +38,7 @@ test-php-73:
- ln -s vendor/eappointment/zmsdb/tests/Zmsdb/fixtures data
- vendor/bin/importTestData --commit
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
MYSQL_PORT: "tcp://mysql:3306"
MYSQL_DATABASE: zmsbo
MYSQL_ROOT_PASSWORD: zmsapi
Expand Down Expand Up @@ -73,8 +73,8 @@ outdated:
apidoc:
stage: .pre
variables:
PHP_VERSION: "7.3"
image: registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev
PHP_VERSION: "8.0"
image: ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev
before_script:
- $CLI_COMPOSER --no-scripts
- bin/configure
Expand Down
4 changes: 2 additions & 2 deletions zmsapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG PHP_VERSION
FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build
COPY --chown=1000:1000 . /var/www/html
WORKDIR /var/www/html
USER 1000
RUN make live

FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base
COPY --from=build --chown=0:0 /var/www/html /var/www/html
RUN chmod -R 1777 /var/www/html/data
6 changes: 3 additions & 3 deletions zmscalldisplay/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include:
remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml

test-php-73:
test-php-80:
extends: .test-php
allow_failure: false
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
only:
changes:
- .gitlab-ci.yml
Expand Down Expand Up @@ -53,7 +53,7 @@ pages:
build-docker:
extends: .build-docker
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
only:
- tags
- main
Expand Down
4 changes: 2 additions & 2 deletions zmscalldisplay/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG PHP_VERSION
FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build
COPY --chown=1000:1000 . /var/www/html
WORKDIR /var/www/html
USER 1000
RUN make live

FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base
COPY --from=build --chown=0:0 /var/www/html /var/www/html
4 changes: 2 additions & 2 deletions zmsclient/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ build-mockup:
- docker build --pull -t "${MOCKUP_IMAGE}" tests/mockup/
- docker push "${MOCKUP_IMAGE}"

test-php-73:
test-php-80:
extends: .test-php
allow_failure: false
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
ZMS_API_URL: http://mockupserver:8083
services:
- name: $MOCKUP_IMAGE
Expand Down
2 changes: 1 addition & 1 deletion zmsclient/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
test:
depends_on:
- mockup
image: registry.gitlab.com/eappointment/php-base:7.3-base
image: ghcr.io/it-at-m/eappointment-php-base:8.0-base
volumes:
- type: bind
source: "."
Expand Down
2 changes: 1 addition & 1 deletion zmsclient/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
stopOnFailure="true"
stopOnFailure="false"
verbose="true"
processIsolation="false"
>
Expand Down
28 changes: 17 additions & 11 deletions zmsclient/src/Zmsclient/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Result
protected $data = null;

/**
* @var Metaresult|null
*/
* @var Metaresult|null
*/
protected $meta = null;

/**
Expand All @@ -55,7 +55,7 @@ public function __construct(
*/
public function setResponse(ResponseInterface $response)
{
$body = Validator::value((string)$response->getBody())->isJson();
$body = Validator::value((string) $response->getBody())->isJson();
$this->testMeta($body, $response);
$result = $body->getValue();
if (array_key_exists("data", $result)) {
Expand All @@ -74,10 +74,10 @@ public function setResponse(ResponseInterface $response)
protected function testMeta($body, ResponseInterface $response)
{
if ($body->hasFailed()) {
$content = (string)$response->getBody();
$content = (string) $response->getBody();
throw new Exception\ApiFailed(
'API-Call failed, JSON parsing with error: ' . $body->getMessages()
. ' - Snippet: ' .substr(\strip_tags($content), 0, 2000) . '[...]',
. ' - Snippet: ' . substr(\strip_tags($content), 0, 2000) . '[...]',
$response,
$this->request
);
Expand Down Expand Up @@ -203,20 +203,26 @@ public function getMeta()
}

/**
* Description
* Get the list of IDs from the data
*
* @return String
* @return string
*/
public function getIds()
{
$data = $this->getData();
$idList = array();
$idList = [];

foreach ($data as $item) {
if (array_key_exists('id', $item)) {
if (is_object($item) && method_exists($item, 'getId')) {
$idList[] = $item->getId();
} elseif (is_array($item) && array_key_exists('id', $item)) {
$idList[] = $item['id'];
} else {
throw new \UnexpectedValueException('Item is neither array nor object with getId() method');
}
}
return join(',', array_unique($idList));

return implode(',', array_unique($idList));
}

/**
Expand All @@ -232,7 +238,7 @@ public function setData(array $data)
$data = [$data];
}
foreach ($data as $entityData) {
if (! array_key_exists('$schema', $entityData)) {
if (!array_key_exists('$schema', $entityData)) {
$entityData['$schema'] = $data[0]['$schema'];
}
$this->data[] = Factory::create($entityData)->getEntity();
Expand Down
4 changes: 2 additions & 2 deletions zmsdb/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include:
remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml

test-php-73:
test-php-80:
extends: .test-php
cache: []
allow_failure: false
Expand All @@ -13,7 +13,7 @@ test-php-73:
- $CLI_COMPOSER
- bin/importTestData --commit
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
MYSQL_DATABASE: zmsbo
MYSQL_ROOT_PASSWORD: mysql
only:
Expand Down
4 changes: 2 additions & 2 deletions zmsdldb/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include:
remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml

test-php-73:
test-php-80:
extends: .test-php
allow_failure: false
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
only:
changes:
- composer.lock
Expand Down
4 changes: 2 additions & 2 deletions zmsentities/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include:
remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml

test-php-73:
test-php-80:
extends: .test-php
allow_failure: false
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
only:
changes:
- composer.lock
Expand Down
4 changes: 2 additions & 2 deletions zmsmessaging/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG PHP_VERSION
FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build
COPY --chown=1000:1000 . /var/www/html
WORKDIR /var/www/html
USER 1000
RUN make live

FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base
COPY --from=build --chown=0:0 /var/www/html /var/www/html
4 changes: 2 additions & 2 deletions zmsstatistic/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include:
remote: https://gitlab.com/eappointment/php-base/-/raw/main/template-php-ci.yml

test-php-73:
test-php-80:
extends: .test-php
allow_failure: false
variables:
PHP_VERSION: "7.3"
PHP_VERSION: "8.0"
only:
changes:
- .gitlab-ci.yml
Expand Down
4 changes: 2 additions & 2 deletions zmsstatistic/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG PHP_VERSION
FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build
COPY --chown=1000:1000 . /build
WORKDIR /build
USER 1000:1000
RUN make live

FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base
COPY --from=build --chown=0:0 /build /var/www/html
4 changes: 2 additions & 2 deletions zmsticketprinter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG PHP_VERSION
FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-dev as build
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-dev as build
COPY --chown=1000:1000 . /var/www/html
WORKDIR /var/www/html
USER 1000
RUN make live

FROM registry.gitlab.com/eappointment/php-base:${PHP_VERSION}-base
FROM ghcr.io/it-at-m/eappointment-php-base:${PHP_VERSION}-base
COPY --from=build --chown=0:0 /var/www/html /var/www/html

0 comments on commit e251db1

Please sign in to comment.