Skip to content

Commit b904722

Browse files
committed
Refactor development commands and testing stack. Change docs.
1 parent 0aa2c9d commit b904722

File tree

63 files changed

+427
-510
lines changed

Some content is hidden

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

63 files changed

+427
-510
lines changed

.ddev/commands/host/.test-single

-60
This file was deleted.

.ddev/commands/host/ci

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/bin/bash
2+
3+
## Description: Run matrix tests from TYPO3_VERSIONS, PHP_VERSIONS, composer "lowest/highest".
4+
## Usage: "ci"
5+
## Example: "ddev ci" or "ddev ci all" or "ddev ci 12 8.3 lowest"
6+
7+
set -e
8+
9+
source .ddev/test/utils.sh
10+
export_ddev_env_vars
11+
12+
ci_single() {
13+
TYPO3=$1
14+
PHP=$2
15+
COMPOSER=${3:-highest}
16+
17+
if [ -z "$TYPO3" ]; then
18+
TYPO3=$(get_lowest_supported_typo3_versions)
19+
else
20+
if ! check_typo3_version "$TYPO3"; then
21+
exit 1
22+
fi
23+
fi
24+
25+
if [ -z "$PHP" ]; then
26+
PHP=$(get_lowest_supported_php_versions_for_typo3 "$TYPO3")
27+
else
28+
if ! check_php_version_for_typo3 "$TYPO3" "$PHP"; then
29+
exit 1
30+
fi
31+
fi
32+
33+
if [[ "$COMPOSER" != "lowest" && "$COMPOSER" != "highest" ]]; then
34+
echo_red "Invalid third argument. COMPOSER value can only be 'lowest' or 'highest'."
35+
exit 1
36+
fi
37+
38+
echo_magenta "-------------------------------------------------"
39+
echo_magenta "| TYPO3 \t| PHP\t\t| Composer\t|"
40+
echo_magenta "-------------------------------------------------"
41+
echo_magenta "| $TYPO3\t\t| $PHP\t\t| $COMPOSER\t|"
42+
echo_magenta "-------------------------------------------------"
43+
echo_magenta ""
44+
45+
ddev config --php-version="$PHP"
46+
ddev restart
47+
if [ "$COMPOSER" == "lowest" ]; then
48+
ddev exec composer update --prefer-lowest --prefer-stable
49+
else
50+
ddev exec composer update
51+
fi
52+
ddev composer normalize
53+
ddev install "$TYPO3"
54+
ddev composer ci
55+
}
56+
57+
if [ $# -eq 0 ]; then
58+
ddev composer ci
59+
ddev docs ci
60+
exit 0
61+
fi
62+
63+
TYPO3=${1}
64+
65+
if [ "$TYPO3" == "all" ]; then
66+
COMPOSER_INSTALLS=("lowest" "highest")
67+
68+
TYPO3_VERSIONS_ARRAY=()
69+
while IFS= read -r line; do
70+
TYPO3_VERSIONS_ARRAY+=("$line")
71+
done < <(get_supported_typo3_versions)
72+
73+
for TYPO3 in "${TYPO3_VERSIONS_ARRAY[@]}"; do
74+
PHP_VERSIONS=()
75+
while IFS= read -r line; do
76+
PHP_VERSIONS+=("$line")
77+
done < <(get_supported_php_versions_for_typo3 "$TYPO3")
78+
for PHP in "${PHP_VERSIONS[@]}"; do
79+
for COMPOSER in "${COMPOSER_INSTALLS[@]}"; do
80+
ci_single "$TYPO3" "$PHP" "$COMPOSER"
81+
done
82+
done
83+
done
84+
ddev docs ci
85+
else
86+
PHP=${2}
87+
COMPOSER=${3}
88+
ci_single "$TYPO3" "$PHP" "$COMPOSER"
89+
ddev docs ci
90+
fi

.ddev/commands/host/docs

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
#!/bin/bash
22

33
## Description: Build docs or open docs editing in watch mode. Mode "watch" is default.
4-
## Usage: "docs [watch|build]"
5-
## Example: "ddev docs" "ddev docs watch" "ddev docs build"
4+
## Usage: "docs [watch|build|test]"
5+
## Example: "ddev docs" "ddev docs watch" "ddev docs build" "ddev docs test"
66

77
MODE=${1:-watch}
88

99
if [ "$MODE" == "build" ]; then
10-
docker run --rm --pull always -v ./:/project/ ghcr.io/typo3-documentation/render-guides:latest --no-progress --config Documentation Documentation
10+
mkdir -p Documentation-GENERATED-temp
11+
docker run --rm --pull always -v ./:/project/ ghcr.io/typo3-documentation/render-guides:latest --no-progress --config Documentation
1112
elif [ "$MODE" == "watch" ]; then
12-
open http://localhost:5174/Documentation-GENERATED-temp/Index.html && docker run --rm -it --pull always -v ./Documentation:/project/Documentation -v ./Documentation-GENERATED-temp:/project/Documentation-GENERATED-temp -p 5174:5173 ghcr.io/garvinhicking/typo3-documentation-browsersync:latest
13+
mkdir -p Documentation-GENERATED-temp
14+
open http://localhost:5173/Documentation-GENERATED-temp/Index.html
15+
docker run --rm -it --pull always \
16+
-v "./Documentation:/project/Documentation" \
17+
-v "./Documentation-GENERATED-temp:/project/Documentation-GENERATED-temp" \
18+
-p 5173:5173 ghcr.io/garvinhicking/typo3-documentation-browsersync:latest
19+
elif [ "$MODE" == "ci" ]; then
20+
mkdir -p Documentation-GENERATED-temp
21+
docker run --rm --pull always -v "$(pwd)":/project -t ghcr.io/typo3-documentation/render-guides:latest --config=Documentation --no-progress --fail-on-log
1322
else
14-
echo "Invalid mode. Please use 'build' or 'watch'."
23+
echo "Invalid mode. Please use 'build', 'watch', or 'test'."
1524
exit 1
1625
fi

.ddev/commands/host/test

-37
This file was deleted.

.ddev/commands/web/.data-export

-63
This file was deleted.

.ddev/commands/web/.data-import

-30
This file was deleted.

0 commit comments

Comments
 (0)