Commit d38a6b31 authored by Tommy Meier's avatar Tommy Meier
Browse files

Integrate deployment

parent ac6044d7
.idea
node_modules
/.build/plugins/
/.build/tmp/
/.build/update/
/*.zip
/CHANGELOG_*.md
/dev-ops/test/vendor
/dist
/lurch
/manual/docs/.vuepress/dist
/manual/docs/.vuepress/public/manual.css
/src/Resources/app/storefront/dist
......
include:
- project: 'shopware6/deployment-base'
file: '.gitlab-ci-template.yml'
variables:
PLUGIN_NAME: NetiNextToolKit
SHOPWARE_RELEASE: 6.4.4.1
{
"version": 1.0,
"frontend-apps": []
}
\ No newline at end of file
# @version 2.0.0 (2109210842)
# Shopware Account Credentials
ACCOUNT_PASSWORD=
ACCOUNT_USER=
# GitLab Client Read API Token
API_CLIENT_TOKEN=
CI_PROJECT_ID=2299
CI_PROJECT_DIR=/build/NetiNextToolKit
PLUGIN_NAME=NetiNextToolKit
RELEASE_PATH=/projects/2299/packages/generic/releases
{
"require-dev": {
"phpstan/phpstan": "^0.12.59",
"phpro/grumphp": "^v0.22.0",
"squizlabs/php_codesniffer": "^3.5.8",
"symplify/easy-coding-standard": "^8.3.48",
"phpstan/phpstan-symfony": "^0.12.11"
},
"extra": {
"grumphp": {
"project-path": "../../"
}
}
}
This diff is collapsed.
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer;
use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer;
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer;
use PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer;
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
use SlevomatCodingStandard\Sniffs\Arrays\DisallowImplicitArrayCreationSniff;
use SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff;
use SlevomatCodingStandard\Sniffs\Exceptions\DeadCatchSniff;
use SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff;
use SlevomatCodingStandard\Sniffs\Functions\UselessParameterDefaultValueSniff;
use SlevomatCodingStandard\Sniffs\Namespaces\UnusedUsesSniff;
use SlevomatCodingStandard\Sniffs\Namespaces\UseFromSameNamespaceSniff;
use SlevomatCodingStandard\Sniffs\Namespaces\UselessAliasSniff;
use SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/psr12.php');
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/php71.php');
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/clean-code.php');
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/common/array.php');
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/common/comments.php');
$containerConfigurator->import(
__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/common/control-structures.php'
);
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/common/docblock.php');
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/common/namespaces.php');
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/common/spaces.php');
$containerConfigurator->import(__DIR__ . '/vendor/symplify/easy-coding-standard/config/set/common/strict.php');
$services = $containerConfigurator->services();
$services->set(YodaStyleFixer::class)->call('configure', [
[
'equal' => true,
'identical' => true,
'less_and_greater' => false,
],
]);
$services->set(CastSpacesFixer::class)->call('configure', [
[
'space' => 'single',
],
]);
$services->set(BinaryOperatorSpacesFixer::class)->call('configure', [
[
'align_double_arrow' => true,
'align_equals' => true,
],
]);
$services->set(IsNullFixer::class)->call('configure', [
[
'use_yoda_style' => true,
],
]);
$services->set(DisallowImplicitArrayCreationSniff::class);
$services->set(ClassConstantVisibilitySniff::class);
$services->set(DeadCatchSniff::class);
$services->set(UnusedParameterSniff::class);
$services->set(UselessParameterDefaultValueSniff::class);
$services->set(UnusedUsesSniff::class);
$services->set(UseFromSameNamespaceSniff::class);
$services->set(UselessAliasSniff::class);
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SKIP, [
TrimArraySpacesFixer::class => null,
NotOperatorWithSuccessorSpaceFixer::class => null,
DuplicateSpacesSniff::class => null,
UnusedParameterSniff::class => null,
NoSuperfluousPhpdocTagsFixer::class => null,
]);
};
grumphp:
hooks_dir: ./resources/hooks
stop_on_failure: true
ascii:
failed: ~
succeeded: ~
git_hook_variables:
PHP_BIN: php7.3
HOOK_CONFIG: --config dev-ops/test/grumphp.yml
tasks:
phpstan:
configuration: dev-ops/test/phpstan.neon
use_grumphp_paths: true
level: 8
ecs:
config: dev-ops/test/ecs.php
paths: [ src/ ]
clear-cache: true
<?php
declare(strict_types=1);
use PackageVersions\Versions;
use Shopware\Core\Framework\Plugin\KernelPluginLoader\StaticKernelPluginLoader;
use Shopware\Development\Kernel;
use Symfony\Component\Dotenv\Dotenv;
$autoLoadFile = __DIR__ . '/../../../../../vendor/autoload.php';
$classLoader = require $autoLoadFile;
(new Dotenv(true))->load(__DIR__ . '/../../../../../.env');
$shopwareVersion = Versions::getVersion('shopware/platform');
$pluginLoader = new StaticKernelPluginLoader($classLoader);
$cacheId = 'default';
$kernel = new Kernel('dev', true, $pluginLoader, $cacheId, $shopwareVersion);
try {
$kernel->boot();
} catch (\Doctrine\DBAL\Exception\DriverException $e) {}
$cacheDir = basename($kernel->getCacheDir());
$phpStanConfigDist = file_get_contents(__DIR__ . '/phpstan.neon.dist');
if ($phpStanConfigDist === false) {
throw new RuntimeException('phpstan.neon.dist file not found');
}
// because the cache dir is hashed by Shopware, we need to set the PHPStan config dynamically
$phpStanConfig = str_replace('%SHOPWARE_CACHE_FOLDER%', $cacheDir, $phpStanConfigDist);
file_put_contents(__DIR__ . '/phpstan.neon', $phpStanConfig);
includes:
- vendor/phpstan/phpstan-symfony/extension.neon
parameters:
checkMissingIterableValueType: false
bootstrapFiles:
- ../../../../../vendor/autoload.php
scanDirectories:
- ../../src
paths:
- ../../src
excludes_analyse:
- ../../dev-ops
symfony:
container_xml_path: '../../../../../var/cache/dev_hb9664dde44c68205efd6c597796e69bc/srcShopware_Development_KernelDevDebugContainer.xml'
includes:
- vendor/phpstan/phpstan-symfony/extension.neon
parameters:
checkMissingIterableValueType: false
bootstrapFiles:
- ../../../../../vendor/autoload.php
scanDirectories:
- ../../src
paths:
- ../../src
excludes_analyse:
- ../../dev-ops
symfony:
container_xml_path: '../../../../../var/cache/%SHOPWARE_CACHE_FOLDER%/srcShopware_Development_KernelDevDebugContainer.xml'
#!/bin/sh
#
# Run the hook command.
# Note: this will be replaced by the real command during copy.
#
GIT_USER=$(git config user.name)
GIT_EMAIL=$(git config user.email)
COMMIT_MSG_FILE=$1
# Fetch the GIT diff and format it as command input:
DIFF=$(git -c diff.mnemonicprefix=false --no-pager diff -r -p -m -M --full-index --no-color --staged | cat)
# Grumphp env vars
$(ENV)
export GRUMPHP_GIT_WORKING_DIR=$(git rev-parse --show-toplevel)
# Run GrumPHP
(cd "${HOOK_EXEC_PATH}" && printf "%s\n" "${DIFF}" | $(EXEC_GRUMPHP_COMMAND) $(HOOK_COMMAND) "--git-user='$GIT_USER'" "--git-email='$GIT_EMAIL'" "$COMMIT_MSG_FILE")
#!/bin/sh
#
# Run the hook command.
# Note: this will be replaced by the real command during copy.
#
# Fetch the GIT diff and format it as command input:
DIFF=$(git -c diff.mnemonicprefix=false --no-pager diff -r -p -m -M --full-index --no-color --staged | cat)
# Grumphp env vars
$(ENV)
export GRUMPHP_GIT_WORKING_DIR=$(git rev-parse --show-toplevel)
$(PHP_BIN) ${GRUMPHP_GIT_WORKING_DIR}/dev-ops/test/phpstan-config-generator.php
# Run GrumPHP
(cd "${HOOK_EXEC_PATH}" && printf "%s\n" "${DIFF}" | $(EXEC_GRUMPHP_COMMAND) $(PHP_BIN) $(HOOK_COMMAND) $(HOOK_CONFIG) '--skip-success-output')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment