2023-01-31 07:51:13 +01:00
|
|
|
{ pkgs ? import <nixpkgs> { } }:
|
|
|
|
|
|
|
|
let
|
2023-08-28 15:37:43 +02:00
|
|
|
php = pkgs.php82.buildEnv {
|
|
|
|
extensions = { enabled, all }: enabled ++ (with all; [
|
|
|
|
xdebug
|
|
|
|
]);
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
xdebug.mode = debug
|
|
|
|
memory_limit = 4G
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
inherit(pkgs.php82Packages) composer;
|
|
|
|
|
2023-01-31 07:51:13 +01:00
|
|
|
projectInstall = pkgs.writeShellApplication {
|
|
|
|
name = "project-install";
|
|
|
|
runtimeInputs = [
|
2023-08-28 15:37:43 +02:00
|
|
|
php
|
|
|
|
composer
|
2023-01-31 07:51:13 +01:00
|
|
|
];
|
|
|
|
text = ''
|
2023-08-28 15:37:43 +02:00
|
|
|
rm -rf .Build/ vendor/ composer.lock
|
|
|
|
composer update --prefer-dist --no-progress --working-dir="$PROJECT_ROOT"
|
2023-01-31 07:51:13 +01:00
|
|
|
'';
|
|
|
|
};
|
2023-12-05 09:43:55 +01:00
|
|
|
|
|
|
|
projectCgl = pkgs.writeShellApplication {
|
|
|
|
name = "project-cgl";
|
|
|
|
|
|
|
|
runtimeInputs = [
|
|
|
|
php
|
|
|
|
];
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run --diff
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
projectCglFix = pkgs.writeShellApplication {
|
|
|
|
name = "project-cgl-fix";
|
|
|
|
|
|
|
|
runtimeInputs = [
|
|
|
|
php
|
|
|
|
];
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-01-31 07:51:13 +01:00
|
|
|
projectTestAcceptance = pkgs.writeShellApplication {
|
|
|
|
name = "project-test-acceptance";
|
|
|
|
runtimeInputs = [
|
|
|
|
projectInstall
|
|
|
|
pkgs.sqlite
|
|
|
|
pkgs.firefox
|
|
|
|
pkgs.geckodriver
|
2023-08-28 15:37:43 +02:00
|
|
|
php
|
2023-01-31 07:51:13 +01:00
|
|
|
];
|
|
|
|
text = ''
|
|
|
|
project-install
|
|
|
|
|
|
|
|
export INSTANCE_PATH="$PROJECT_ROOT/.Build/web/typo3temp/var/tests/acceptance"
|
|
|
|
export typo3DatabaseDriver=pdo_sqlite
|
|
|
|
|
|
|
|
mkdir -p "$INSTANCE_PATH"
|
|
|
|
./vendor/bin/codecept run
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in pkgs.mkShell {
|
|
|
|
name = "TYPO3 Extension ThüCAT";
|
|
|
|
buildInputs = [
|
2023-08-28 15:37:43 +02:00
|
|
|
php
|
|
|
|
composer
|
|
|
|
projectInstall
|
2023-12-05 09:43:55 +01:00
|
|
|
projectCgl
|
|
|
|
projectCglFix
|
2023-01-31 07:51:13 +01:00
|
|
|
projectTestAcceptance
|
|
|
|
];
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
export PROJECT_ROOT="$(pwd)"
|
|
|
|
'';
|
|
|
|
}
|