Skip to content

Commit 5a3b35d

Browse files
committed
[#1580] Allow to choose tools in the installer.
1 parent fe3a01c commit 5a3b35d

418 files changed

Lines changed: 12531 additions & 929 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ahoy.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ commands:
8080
usage: Show container logs for services.
8181
cmd: docker compose logs "$@"
8282

83+
# Drop into a shell if no arguments are supplied, otherwise run the command.
84+
# Environment variables are passed from the host and filtered by prefix.
85+
# Use \" (slash followed by a double quote) to escape double quotes in
86+
# arguments that contain spaces.
8387
cli:
8488
usage: Start a shell or run a command inside the CLI service container.
85-
# Drop into a shell if no arguments are supplied, otherwise run the command.
86-
# Environment variables are passed from the host and filtered by prefix.
87-
# Use \" (slash followed by a double quote) to escape double quotes in
88-
# arguments that contain spaces.
8989
cmd: |
9090
if [ "${#}" -ne 0 ]; then
9191
docker compose exec $(env | cut -f1 -d= | grep "TERM\|COMPOSE_\|GITHUB_\|PACKAGE_\|DOCKER_\|DRUPAL_\|VORTEX_" | sed 's/^/-e /') cli bash -c "$*"
@@ -122,7 +122,7 @@ commands:
122122
#;< !PROVISION_TYPE_PROFILE
123123
download-db:
124124
usage: Download database. Run with "--no-cache" option to force fresh database backup.
125-
aliases: ['fetch-db']
125+
aliases: [fetch-db]
126126
cmd: |
127127
case " $* " in *" --no-cache "*) export VORTEX_DB_DOWNLOAD_NO_CACHE=1;; esac
128128
./scripts/vortex/download-db.sh
@@ -158,7 +158,7 @@ commands:
158158
cmd: \[ -n "${VORTEX_DB_IMAGE}" \] && docker pull ${VORTEX_DB_IMAGE} || true
159159

160160
reset:
161-
usage: "Remove containers, all build files. Use with `hard` to reset repository to the last commit."
161+
usage: Remove containers, all build files. Use with `hard` to reset repository to the last commit.
162162
cmd: |
163163
ahoy confirm "All containers and build files will be removed. Proceed?" || exit 0
164164
AHOY_CONFIRM_RESPONSE=y ahoy down
@@ -190,7 +190,10 @@ commands:
190190

191191
lint:
192192
usage: Lint back-end and front-end code.
193-
cmd: ahoy lint-be && ahoy lint-fe && ahoy lint-tests
193+
cmd: |
194+
ahoy lint-be
195+
ahoy lint-fe
196+
ahoy lint-tests
194197
195198
lint-be:
196199
usage: Lint back-end code.
@@ -211,11 +214,14 @@ commands:
211214
212215
lint-tests:
213216
usage: Lint tests code.
214-
cmd: ahoy cli vendor/bin/gherkinlint lint tests/behat/features
217+
cmd: |
218+
ahoy cli vendor/bin/gherkinlint lint tests/behat/features
215219
216220
lint-fix:
217221
usage: Fix lint issues of back-end and front-end code.
218-
cmd: ahoy lint-be-fix && ahoy lint-fe-fix
222+
cmd: |
223+
ahoy lint-be-fix
224+
ahoy lint-fe-fix
219225
220226
lint-be-fix:
221227
usage: Fix lint issues of back-end code.
@@ -234,7 +240,11 @@ commands:
234240
235241
test:
236242
usage: Run all tests.
237-
cmd: ahoy test-unit && ahoy test-kernel && ahoy test-functional && ahoy test-bdd
243+
cmd: |
244+
ahoy test-unit
245+
ahoy test-kernel
246+
ahoy test-functional
247+
ahoy test-bdd
238248
239249
test-unit:
240250
usage: Run PHPUnit unit tests.
@@ -250,7 +260,7 @@ commands:
250260

251261
test-bdd:
252262
usage: Run BDD tests.
253-
aliases: ['test-behat']
263+
aliases: [test-behat]
254264
cmd: ahoy cli php -d memory_limit=-1 vendor/bin/behat --colors "$@"
255265

256266
debug:
@@ -274,8 +284,7 @@ commands:
274284
local:
275285
usage: Custom local commands. See `ahoy local help`.
276286
optional: true
277-
imports:
278-
- .ahoy.local.yml
287+
imports: [.ahoy.local.yml]
279288

280289
# ----------------------------------------------------------------------------
281290
# Utilities.
@@ -307,15 +316,14 @@ commands:
307316
hide: true
308317

309318
# Override entrypoint to alter default behavior of Ahoy.
319+
# 1. Exit the script if any statement returns a non-true return value.
320+
# 2. Read variables from .env file (while respecting existing values) to load
321+
# and pass updated environment variables' values into already running
322+
# containers.
310323
entrypoint:
311324
- bash
312325
- -c
313-
# Exit the script if any statement returns a non-true return value.
314326
- -e
315-
# Read variables from .env file, respecting existing values.
316-
# - Used to load and pass updated environment variables' values into already
317-
# running containers.
318-
# - Use `ahoy up cli` in cases when changes require container restart.
319327
- |
320328
t=$(mktemp) && export -p > "$t" && set -a && . ./.env && if [ -f ./.env.local ];then . ./.env.local;fi && set +a && . "$t" && rm "$t" && unset t
321329
bash -e -c "$0" "$@"

.circleci/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,41 +286,51 @@ jobs:
286286
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
287287
docker compose exec -T cli composer normalize --dry-run || [ "${VORTEX_CI_COMPOSER_NORMALIZE_IGNORE_FAILURE:-0}" -eq 1 ]
288288
289+
#;< TOOL_PHPCS
289290
- run:
290291
name: Lint code with PHPCS
291292
command: |
292293
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
293294
docker compose exec -T cli vendor/bin/phpcs || [ "${VORTEX_CI_PHPCS_IGNORE_FAILURE:-0}" -eq 1 ]
295+
#;> TOOL_PHPCS
294296

297+
#;< TOOL_PHPSTAN
295298
- run:
296299
name: Lint code with PHPStan
297300
command: |
298301
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
299302
docker compose exec -T cli vendor/bin/phpstan || [ "${VORTEX_CI_PHPSTAN_IGNORE_FAILURE:-0}" -eq 1 ]
303+
#;> TOOL_PHPSTAN
300304

305+
#;< TOOL_RECTOR
301306
- run:
302307
name: Lint code with Rector
303308
command: |
304309
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
305310
docker compose exec -T cli vendor/bin/rector --clear-cache --dry-run || [ "${VORTEX_CI_RECTOR_IGNORE_FAILURE:-0}" -eq 1 ]
311+
#;> TOOL_RECTOR
306312

313+
#;< TOOL_PHPMD
307314
- run:
308315
name: Lint code with PHPMD
309316
command: |
310317
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
311318
docker compose exec -T cli vendor/bin/phpmd . text phpmd.xml || [ "${VORTEX_CI_PHPMD_IGNORE_FAILURE:-0}" -eq 1 ]
319+
#;> TOOL_PHPMD
312320

313321
- run:
314322
name: Lint code with Twig CS Fixer
315323
command: |
316324
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
317325
docker compose exec -T cli vendor/bin/twig-cs-fixer || [ "${VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE:-0}" -eq 1 ]
318326
327+
#;< TOOL_BEHAT
319328
- run:
320329
name: Lint code with Gherkin Lint
321330
command: |
322331
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
323332
docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features || [ "${VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE:-0}" -eq 1 ]
333+
#;> TOOL_BEHAT
324334

325335
- run:
326336
name: Lint module code with NodeJS linters
@@ -346,10 +356,13 @@ jobs:
346356
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli ./scripts/vortex/provision.sh
347357
no_output_timeout: 30m
348358

359+
#;< TOOL_PHPUNIT
349360
- run:
350361
name: Test with PHPUnit
351362
command: docker compose exec -T cli vendor/bin/phpunit || [ "${VORTEX_CI_PHPUNIT_IGNORE_FAILURE:-0}" -eq 1 ]
363+
#;> TOOL_PHPUNIT
352364

365+
#;< TOOL_BEHAT
353366
- run:
354367
name: Test with Behat
355368
command: |
@@ -359,6 +372,7 @@ jobs:
359372
docker compose exec -T cli php -d memory_limit=-1 vendor/bin/behat --colors --strict --rerun --profile="${VORTEX_CI_BEHAT_PROFILE:-default}" || \
360373
[ "${VORTEX_CI_BEHAT_IGNORE_FAILURE:-0}" -eq 1 ]
361374
no_output_timeout: 30m
375+
#;> TOOL_BEHAT
362376

363377
- run:
364378
name: Process test logs and artifacts

.github/workflows/build-test-deploy.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,35 +269,45 @@ jobs:
269269
run: docker compose exec -T cli composer normalize --dry-run
270270
continue-on-error: ${{ vars.VORTEX_CI_COMPOSER_NORMALIZE_IGNORE_FAILURE == '1' }}
271271

272+
#;< TOOL_PHPCS
272273
- name: Lint code with PHPCS
273274
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
274275
run: docker compose exec -T cli vendor/bin/phpcs
275276
continue-on-error: ${{ vars.VORTEX_CI_PHPCS_IGNORE_FAILURE == '1' }}
277+
#;> TOOL_PHPCS
276278

279+
#;< TOOL_PHPSTAN
277280
- name: Lint code with PHPStan
278281
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
279282
run: docker compose exec -T cli vendor/bin/phpstan
280283
continue-on-error: ${{ vars.VORTEX_CI_PHPSTAN_IGNORE_FAILURE == '1' }}
284+
#;> TOOL_PHPSTAN
281285

286+
#;< TOOL_RECTOR
282287
- name: Lint code with Rector
283288
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
284289
run: docker compose exec -T cli vendor/bin/rector --clear-cache --dry-run
285290
continue-on-error: ${{ vars.VORTEX_CI_RECTOR_IGNORE_FAILURE == '1' }}
291+
#;> TOOL_RECTOR
286292

293+
#;< TOOL_PHPMD
287294
- name: Lint code with PHPMD
288295
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
289296
run: docker compose exec -T cli vendor/bin/phpmd . text phpmd.xml
290297
continue-on-error: ${{ vars.VORTEX_CI_PHPMD_IGNORE_FAILURE == '1' }}
298+
#;> TOOL_PHPMD
291299

292300
- name: Lint code with Twig CS Fixer
293301
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
294302
run: docker compose exec -T cli vendor/bin/twig-cs-fixer
295303
continue-on-error: ${{ vars.VORTEX_CI_TWIG_CS_FIXER_IGNORE_FAILURE == '1' }}
296304

305+
#;< TOOL_BEHAT
297306
- name: Lint code with Gherkin Lint
298307
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
299308
run: docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features
300309
continue-on-error: ${{ vars.VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE == '1' }}
310+
#;> TOOL_BEHAT
301311

302312
- name: Lint module code with NodeJS linters
303313
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
@@ -320,10 +330,13 @@ jobs:
320330
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli ./scripts/vortex/provision.sh
321331
timeout-minutes: 30
322332

333+
#;< TOOL_PHPUNIT
323334
- name: Test with PHPUnit
324335
run: docker compose exec -T cli vendor/bin/phpunit
325336
continue-on-error: ${{ vars.VORTEX_CI_PHPUNIT_IGNORE_FAILURE == '1' }}
337+
#;> TOOL_PHPUNIT
326338

339+
#;< TOOL_BEHAT
327340
- name: Test with Behat
328341
run: |
329342
# shellcheck disable=SC2170
@@ -335,6 +348,7 @@ jobs:
335348
VORTEX_CI_BEHAT_PROFILE: ${{ vars.VORTEX_CI_BEHAT_PROFILE }}
336349
continue-on-error: ${{ vars.VORTEX_CI_BEHAT_IGNORE_FAILURE == '1' }}
337350
timeout-minutes: 30
351+
#;> TOOL_BEHAT
338352

339353
- name: Process test logs and artifacts
340354
if: always()

.vortex/installer/composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
},
1919
"require": {
2020
"php": ">=8.2",
21-
"alexskrypnyk/file": "^0.8.0",
21+
"alexskrypnyk/file": "^0.9",
2222
"alexskrypnyk/str2name": "^1.4",
23+
"composer/composer": "^2.8",
2324
"cweagans/composer-patches": "^1.7",
2425
"czproject/git-php": "^4.3",
2526
"laravel/prompts": "^0.3.5",
27+
"nikic/iter": "^2.4",
2628
"sebastian/diff": "*",
2729
"symfony/console": "^7.3",
2830
"symfony/filesystem": "^7.2",
@@ -93,6 +95,7 @@
9395
"reset": "rm -Rf vendor vendor-bin",
9496
"test": "phpunit --no-coverage",
9597
"test-coverage": "php -d pcov.directory=. vendor/bin/phpunit",
96-
"test-fixtures": "UPDATE_FIXTURES=1 phpunit --no-coverage --filter=testInstall"
98+
"test-fixtures": "UPDATE_FIXTURES=1 phpunit --no-coverage --filter=testInstall",
99+
"test-baseline": "UPDATE_FIXTURES=1 phpunit --no-coverage --filter=testInstall@baseline || UPDATE_FIXTURES=1 phpunit --no-coverage --filter=testInstall@baseline"
97100
}
98101
}

0 commit comments

Comments
 (0)