-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from upmind-automation/TR-77-update-for-compat…
…ibility-with-base-library-v4 Update for base library v4
- Loading branch information
Showing
46 changed files
with
1,242 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM php:8.1-cli | ||
|
||
# Install dependencies | ||
RUN apt update && \ | ||
apt upgrade -y && \ | ||
apt install -y \ | ||
git \ | ||
curl \ | ||
zip \ | ||
unzip \ | ||
libxml2-dev | ||
|
||
# Install additional PHP extensions | ||
RUN docker-php-ext-install soap | ||
|
||
# Install Packages via PECL as not provided by PHP Source | ||
RUN pecl install xdebug \ | ||
&& docker-php-ext-enable xdebug | ||
|
||
# Clear cache | ||
RUN apt clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install composer (get latest v2, change to `--1` if you want to install the latest v1). | ||
RUN curl -sS https://getcomposer.org/installer | php -- --2 --install-dir=/usr/local/bin --filename=composer | ||
|
||
COPY . /usr/src/lib | ||
WORKDIR /usr/src/lib | ||
|
||
CMD [ "php"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM php:8.2-cli | ||
|
||
# Install dependencies | ||
RUN apt update && \ | ||
apt upgrade -y && \ | ||
apt install -y \ | ||
git \ | ||
curl \ | ||
zip \ | ||
unzip \ | ||
libxml2-dev | ||
|
||
# Install additional PHP extensions | ||
RUN docker-php-ext-install soap | ||
|
||
# Install Packages via PECL as not provided by PHP Source | ||
RUN pecl install xdebug \ | ||
&& docker-php-ext-enable xdebug | ||
|
||
# Clear cache | ||
RUN apt clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install composer (get latest v2, change to `--1` if you want to install the latest v1). | ||
RUN curl -sS https://getcomposer.org/installer | php -- --2 --install-dir=/usr/local/bin --filename=composer | ||
|
||
COPY . /usr/src/lib | ||
WORKDIR /usr/src/lib | ||
|
||
CMD [ "php"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM php:8.3-cli | ||
|
||
# Install dependencies | ||
RUN apt update && \ | ||
apt upgrade -y && \ | ||
apt install -y \ | ||
git \ | ||
curl \ | ||
zip \ | ||
unzip \ | ||
libxml2-dev | ||
|
||
# Install additional PHP extensions | ||
RUN docker-php-ext-install soap | ||
|
||
# Install Packages via PECL as not provided by PHP Source | ||
RUN pecl install xdebug \ | ||
&& docker-php-ext-enable xdebug | ||
|
||
# Clear cache | ||
RUN apt clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install composer (get latest v2, change to `--1` if you want to install the latest v1). | ||
RUN curl -sS https://getcomposer.org/installer | php -- --2 --install-dir=/usr/local/bin --filename=composer | ||
|
||
COPY . /usr/src/lib | ||
WORKDIR /usr/src/lib | ||
|
||
CMD [ "php"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Workflow name | ||
name: Static Analysis | ||
|
||
# Triggers | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
# Jobs/Pipelines | ||
jobs: | ||
phpstan: | ||
name: 'PHP Stan' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ 8.1, 8.2, 8.3 ] | ||
steps: | ||
- name: "Checkout Code" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Setup PHP with tools" | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ matrix.php }}" | ||
tools: composer, phpstan | ||
|
||
- name: "Get composer cache directory" | ||
id: composer-cache | ||
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' | ||
|
||
- name: "Cache dependencies" | ||
uses: actions/cache@v4 | ||
with: | ||
path: "${{ steps.composer-cache.outputs.dir }}" | ||
key: "${{ runner.os }}-php-${{ matrix.php}}-composer-${{ hashFiles('**/composer.json') }}" | ||
restore-keys: "${{ runner.os }}-php-${{ matrix.php}}-composer-" | ||
|
||
- name: "Install Composer dependencies" | ||
run: composer install --no-ansi --no-interaction --no-progress --no-scripts --prefer-dist | ||
|
||
- name: "Run PHPStan Static Analysis" | ||
run: phpstan analyse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
vendor | ||
# Composer | ||
composer.lock | ||
vendor/ | ||
|
||
# Tools | ||
.php-cs-fixer.cache | ||
phpunit.xml | ||
phpstan.neon | ||
.phpunit.result.cache | ||
.phpunit.cache/ | ||
|
||
# Docker | ||
.docker/Dockerfile | ||
docker-compose.yml | ||
|
||
# IDE | ||
.vscode/ | ||
.idea/ | ||
.vscode/launch.json | ||
.php-cs-fixer.cache | ||
|
||
# System | ||
.DS_Store | ||
error_log |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
.PHONY: help | ||
|
||
# List all available Makefile commands. | ||
help: | ||
@echo "Available commands:" | ||
@echo " make help : List all available Makefile commands" | ||
@echo " make setup-php81 : Start the dev environment with PHP 8.1" | ||
@echo " make setup-php82 : Start the dev environment with PHP 8.2" | ||
@echo " make setup-php83 : Start the dev environment with PHP 8.3" | ||
@echo " make shell : Get an interactive shell on the PHP container" | ||
@echo " make static-analysis : Run Static Analysis (PHPStan)" | ||
@echo " make coding-standards : Run Coding Standards (PHP-CS-Fixer)" | ||
@echo " make start-containers : Start the dev environment" | ||
@echo " make stop-containers : Stop the dev environment" | ||
@echo " make kill-containers : Stop and remove all containers" | ||
@echo " make composer-install : Install composer dependencies" | ||
|
||
# Typing 'make setup-php81' will start the dev environment with PHP 8.1 | ||
setup-php81: stop-containers --prep-dockerfile-php81 start-containers --remove-packages composer-install | ||
|
||
# Typing 'make setup-php82' will start the dev environment with PHP 8.2 | ||
setup-php82: stop-containers --prep-dockerfile-php82 start-containers --remove-packages composer-install | ||
|
||
# Typing 'make setup-php83' will start the dev environment with PHP 8.3 | ||
setup-php83: stop-containers --prep-dockerfile-php83 start-containers --remove-packages composer-install | ||
|
||
# Get a shell on the PHP container | ||
shell: | ||
docker compose exec -it provision-provider-shared-hosting /bin/bash | ||
|
||
# Run Static Analysis (PHPStan) | ||
static-analysis: | ||
docker compose exec provision-provider-shared-hosting ./vendor/bin/phpstan analyse --memory-limit=1G | ||
|
||
coding-standards: | ||
docker compose exec provision-provider-shared-hosting php ./bin/php-cs-fixer-v3.phar fix --config=./.php-cs-fixer.dist.php | ||
|
||
# Start the dev environment | ||
start-containers: | ||
docker compose up -d --build | ||
|
||
# Stop the dev environment | ||
stop-containers: | ||
docker compose down | ||
|
||
# Stop and remove all containers | ||
kill-containers: | ||
docker compose kill | ||
docker compose rm --force | ||
|
||
# Install composer dependencies | ||
composer-install: | ||
docker compose exec provision-provider-shared-hosting composer install --no-interaction | ||
|
||
# Copy Dockerfile for PHP 8.1 | ||
--prep-dockerfile-php81: --remove-dockerfile --prep-docker-compose-file | ||
cp "./.docker/Dockerfile.php81" "./.docker/Dockerfile" | ||
|
||
# Copy Dockerfile for PHP 8.2 | ||
--prep-dockerfile-php82: --remove-dockerfile --prep-docker-compose-file | ||
cp "./.docker/Dockerfile.php82" "./.docker/Dockerfile" | ||
|
||
# Copy Dockerfile for PHP 8.3 | ||
--prep-dockerfile-php83: --remove-dockerfile --prep-docker-compose-file | ||
cp "./.docker/Dockerfile.php83" "./.docker/Dockerfile" | ||
|
||
# Copy docker-compose.yml file | ||
--prep-docker-compose-file: | ||
[ -f "./docker-compose.yml" ] || cp "./docker-compose.yml.example" "./docker-compose.yml" | ||
|
||
# Remove Dockerfile | ||
--remove-dockerfile: | ||
rm -f ./docker/Dockerfile | ||
|
||
# Remove composer related files | ||
--remove-packages: --remove-lockfile --remove-vendor | ||
|
||
# Remove composer.lock file | ||
--remove-lockfile: | ||
docker compose exec provision-provider-shared-hosting rm -f ./composer.lock | ||
|
||
# Remove vendor directory | ||
--remove-vendor: | ||
docker compose exec provision-provider-shared-hosting rm -rf ./vendor |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '3.3' | ||
services: | ||
|
||
#PHP Service | ||
provision-provider-shared-hosting: | ||
build: | ||
context: . | ||
dockerfile: ./.docker/Dockerfile | ||
container_name: provision-provider-shared-hosting | ||
tty: true | ||
environment: | ||
SERVICE_NAME: provision-provider-shared-hosting | ||
SERVICE_TAGS: dev | ||
working_dir: /usr/src/lib | ||
volumes: | ||
- ./:/usr/src/lib | ||
networks: | ||
- provision-provider-shared-hosting-network | ||
|
||
#Docker Networks | ||
networks: | ||
provision-provider-shared-hosting-network: | ||
driver: bridge |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
parameters: | ||
level: 4 | ||
paths: | ||
- src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.