86 lines
2.0 KiB
Markdown
86 lines
2.0 KiB
Markdown
## To install add Build/composer.json to the project
|
|
```json
|
|
{
|
|
"name": "cp/build",
|
|
"description": "Project deployment with support for deployphp",
|
|
"repositories": [
|
|
{
|
|
"type": "git",
|
|
"url": "https://gitlab.cp-compartner.de/cpcompartner/build-config.git"
|
|
}
|
|
],
|
|
"require": {
|
|
"cp/build-config": "^1.7.3"
|
|
},
|
|
"scripts": {
|
|
"staging": "dep -vv --file=vendor/cp/build-config/deploy.php deploy staging --branch",
|
|
"production": "dep --file=vendor/cp/build-config/deploy.php deploy production --tag",
|
|
|
|
"phpcs-fixer": "php-cs-fixer fix --config=vendor/cp/build-config/php_cs.php",
|
|
"phpstan": "phpstan analyse --configuration=vendor/cp/build-config/phpstan.neon",
|
|
"rector": "rector process --config=vendor/cp/build-config/rector.php",
|
|
"php72-lint": "find ../packages ../private/typo3conf -name '*.php' -exec php7.2 -l {} 1> /dev/null \\;",
|
|
"php74-lint": "find ../packages ../private/typo3conf -name '*.php' -exec php7.4 -l {} 1> /dev/null \\;"
|
|
}
|
|
}
|
|
```
|
|
|
|
## Usage per composer
|
|
|
|
Install it with:
|
|
```bash
|
|
./composer update
|
|
```
|
|
|
|
Deploy branch develop to staging
|
|
```bash
|
|
./composer staging develop
|
|
```
|
|
|
|
Deploy tag 1.0.0 to production
|
|
```bash
|
|
./composer production 1.0.0
|
|
```
|
|
|
|
PHPCS fixer usage:
|
|
```bash
|
|
./composer phpcs-fixer ../package/cp_sitepackage
|
|
```
|
|
|
|
PHPStan usage:
|
|
```bash
|
|
./composer phpstan ../package/cp_sitepackage
|
|
```
|
|
|
|
TYPO3 Rector usage:
|
|
```bash
|
|
./composer rector ../package/cp_sitepackage
|
|
```
|
|
|
|
## Overriding default values per host in hosts.yaml
|
|
```yaml
|
|
.base: &base
|
|
local: true
|
|
alias: '{{CI_HOST}}'
|
|
deploy_path: '{{CI_PROJECT_DIR}}/cache/{{ENVIRONMENT_NAME}}'
|
|
composer_options: '{{composer_action}} --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --no-suggest --ignore-platform-reqs'
|
|
|
|
prepare_dirs:
|
|
- .dep
|
|
- releases
|
|
- shared/fileadmin
|
|
|
|
shared_dirs_private:
|
|
- fileadmin
|
|
|
|
writable_dirs:
|
|
- private/typo3temp
|
|
- var
|
|
writable_files:
|
|
- private/typo3conf/PackageStates.php
|
|
|
|
rsync:
|
|
exclude:
|
|
- '-,p private/typo3temp/var/Cache'
|
|
```
|