Skip to content

Commit 96e2903

Browse files
committed
Refactor ddev for test instances.
1 parent 90f80f6 commit 96e2903

File tree

14 files changed

+118
-113
lines changed

14 files changed

+118
-113
lines changed

.ddev/apache/00-vhost-macro.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
RewriteEngine On
1111
RewriteCond %{HTTP:X-Forwarded-Proto} =https
12-
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
13-
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
12+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
13+
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
1414
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
1515
ErrorLog /dev/stdout
1616
CustomLog ${APACHE_LOG_DIR}/access.log combined
@@ -27,8 +27,8 @@
2727

2828
RewriteEngine On
2929
RewriteCond %{HTTP:X-Forwarded-Proto} =https
30-
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
31-
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
30+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
31+
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
3232
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
3333
ErrorLog /dev/stdout
3434
CustomLog ${APACHE_LOG_DIR}/access.log combined

.ddev/apache/10-index.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Use vhost-macro t3api.ddev.site /var/www/html/
1+
Use vhost-macro t3api.ddev.site /var/www/html/.test

.ddev/apache/30-v10.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Use vhost-macro v10.t3api.ddev.site /var/www/html/v10/public
1+
Use vhost-macro v10.t3api.ddev.site /var/www/html/.test/v10/public

.ddev/apache/31-v10-api.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Use vhost-macro v10-api.t3api.ddev.site /var/www/html/v10/public
1+
Use vhost-macro v10-api.t3api.ddev.site /var/www/html/.test/v10/public

.ddev/apache/40-v11.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Use vhost-macro v11.t3api.ddev.site /var/www/html/v11/public
1+
Use vhost-macro v11.t3api.ddev.site /var/www/html/.test/v11/public

.ddev/apache/41-v11-api.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Use vhost-macro v11-api.t3api.ddev.site /var/www/html/v11/public
1+
Use vhost-macro v11-api.t3api.ddev.site /var/www/html/.test/v11/public

.ddev/commands/web/cache-flush-all

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
## Description: Flush cache for t3api test instances
4+
## Usage: cache-flush-all
5+
## Example: "ddev cache-flush-all"
6+
7+
/usr/bin/php /var/www/html/.test/v10/vendor/bin/typo3cms cache:flush
8+
/usr/bin/php /var/www/html/.test/v11/vendor/bin/typo3cms cache:flush

.ddev/commands/web/install-all

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
## Description: Install TYPO3 10 and TYPO3 11 with t3api linked to it.
4+
## Usage: install-all
5+
## Example: "ddev install-all"
6+
37
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}/.")"
48

59
$ABSOLUTE_PATH/install-v10

.ddev/commands/web/install-v10

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,46 @@
11
#!/bin/bash
22

3+
## Description: Install TYPO3 10 with t3api linked to it.
4+
## Usage: install-v10
5+
## Example: "ddev install-v10"
6+
37
VERSION=v10
4-
DATABASE=database_${VERSION}
8+
DATABASE=database_$VERSION
9+
BASE_PATH=/var/www/html/.test/$VERSION
10+
11+
[ -L /var/www/html/.test/t3api ] || ln -sr /var/www/html/ /var/www/html/.test/t3api
12+
rm -rf $BASE_PATH
13+
mkdir -p $BASE_PATH
514

6-
rm -rf /var/www/html/$VERSION/*
715
mysql -uroot -proot -e "DROP DATABASE IF EXISTS $DATABASE"
816

9-
cd /var/www/html/$VERSION
10-
11-
composer init --name=sourcebroker/typo3$VERSION --description=TYPO3$VERSION -n -d /var/www/html/$VERSION
12-
composer config extra.typo3/cms.web-dir public -d /var/www/html/$VERSION
13-
composer config repositories.$EXTENSION_KEY path ../$EXTENSION_KEY -d /var/www/html/$VERSION
14-
composer req typo3/minimal:'^10.4' typo3/cms-extensionmanager:'^10.4' helhum/typo3-console:'^6.3' jigal/t3adminer:'^9.4' georgringer/news:'^8.0' sourcebroker/t3api:'@dev' sourcebroker/t3apinews:'@dev' --no-progress -n -d /var/www/html/$VERSION
15-
16-
vendor/bin/typo3cms install:setup -n --database-name $DATABASE
17-
vendor/bin/typo3cms configuration:set 'BE/debug' 1
18-
vendor/bin/typo3cms configuration:set 'BE/lockSSL' true
19-
vendor/bin/typo3cms configuration:set 'FE/debug' 1
20-
vendor/bin/typo3cms configuration:set 'SYS/devIPmask' '*'
21-
vendor/bin/typo3cms configuration:set 'SYS/displayErrors' 1
22-
vendor/bin/typo3cms configuration:set 'SYS/trustedHostsPattern' '.*.*'
23-
vendor/bin/typo3cms configuration:set 'MAIL/transport' 'smtp'
24-
vendor/bin/typo3cms configuration:set 'MAIL/transport_smtp_server' 'localhost:1025'
25-
vendor/bin/typo3cms configuration:set 'GFX/processor' 'ImageMagick'
26-
vendor/bin/typo3cms configuration:set 'GFX/processor_path' '/usr/bin/'
27-
vendor/bin/typo3cms configuration:set 'GFX/processor_path_lzw' '/usr/bin/'
28-
vendor/bin/typo3cms install:generatepackagestates
29-
30-
sed -i -e "s/base: ht\//base: \//g" /var/www/html/$VERSION/config/sites/main/config.yaml
31-
sed -i -e 's/base: \/en\//base: \//g' /var/www/html/$VERSION/config/sites/main/config.yaml
32-
printf "imports:\n -\n resource: 'EXT:$EXTENSION_KEY/Configuration/Routing/config.yaml'" >> /var/www/html/$VERSION/config/sites/main/config.yaml
33-
34-
cp -r "/var/www/html/$EXTENSION_KEY/.ddev/data-init/fileadmin/" "/var/www/html/$VERSION/public/"
35-
mysql -uroot -proot $DATABASE < "/var/www/html/$EXTENSION_KEY/.ddev/data-init/$DATABASE.sql"
36-
37-
vendor/bin/typo3cms database:updateschema
38-
vendor/bin/typo3cms cache:flush
17+
composer init --name=sourcebroker/typo3$VERSION --description=TYPO3$VERSION --no-interaction --working-dir $BASE_PATH
18+
composer config extra.typo3/cms.web-dir public --working-dir $BASE_PATH
19+
composer config repositories.$EXTENSION_KEY path ../$EXTENSION_KEY --working-dir $BASE_PATH
20+
composer req typo3/minimal:'^10.4' helhum/typo3-console:'^6.3' jigal/t3adminer:'^9.4' georgringer/news:'^8.0' \
21+
sourcebroker/t3api:'@dev' sourcebroker/t3apinews:'@dev' \
22+
--no-progress --no-interaction --working-dir $BASE_PATH
23+
24+
$BASE_PATH/vendor/bin/typo3cms install:setup -n --database-name $DATABASE
25+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'BE/debug' 1
26+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'BE/lockSSL' true
27+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'FE/debug' 1
28+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'SYS/devIPmask' '*'
29+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'SYS/displayErrors' 1
30+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'SYS/trustedHostsPattern' '.*.*'
31+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'MAIL/transport' 'smtp'
32+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'MAIL/transport_smtp_server' 'localhost:1025'
33+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'GFX/processor' 'ImageMagick'
34+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'GFX/processor_path' '/usr/bin/'
35+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'GFX/processor_path_lzw' '/usr/bin/'
36+
$BASE_PATH/vendor/bin/typo3cms install:generatepackagestates
37+
38+
sed -i -e "s/base: ht\//base: \//g" $BASE_PATH/config/sites/main/config.yaml
39+
sed -i -e 's/base: \/en\//base: \//g' $BASE_PATH/config/sites/main/config.yaml
40+
printf "imports:\n -\n resource: 'EXT:$EXTENSION_KEY/Configuration/Routing/config.yaml'" >> $BASE_PATH/config/sites/main/config.yaml
41+
42+
cp -r "$BASE_PATH/../$EXTENSION_KEY/.ddev/data-init/fileadmin/" "$BASE_PATH/public/"
43+
mysql -uroot -proot $DATABASE < "$BASE_PATH/../$EXTENSION_KEY/.ddev/data-init/$DATABASE.sql"
44+
45+
$BASE_PATH/vendor/bin/typo3cms database:updateschema
46+
$BASE_PATH/vendor/bin/typo3cms cache:flush

.ddev/commands/web/install-v11

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,45 @@
11
#!/bin/bash
22

3+
## Description: Install TYPO3 11 with t3api linked to it.
4+
## Usage: install-v11
5+
## Example: "ddev install-v11"
6+
37
VERSION=v11
4-
DATABASE=database_${VERSION}
8+
DATABASE=database_$VERSION
9+
BASE_PATH=/var/www/html/.test/$VERSION
10+
11+
[ -L /var/www/html/.test/t3api ] || ln -sr /var/www/html/ /var/www/html/.test/t3api
12+
rm -rf $BASE_PATH
13+
mkdir -p $BASE_PATH
514

6-
rm -rf /var/www/html/$VERSION/*
715
mysql -uroot -proot -e "DROP DATABASE IF EXISTS $DATABASE"
816

9-
cd /var/www/html/$VERSION
10-
11-
composer init --name=sourcebroker/typo3$VERSION --description=TYPO3$VERSION -n -d /var/www/html/$VERSION
12-
composer config extra.typo3/cms.web-dir public -d /var/www/html/$VERSION
13-
composer config repositories.$EXTENSION_KEY path ../$EXTENSION_KEY -d /var/www/html/$VERSION
14-
composer req typo3/minimal:'^11.5' typo3/cms-extensionmanager:'^11.5' helhum/typo3-console:'^7.0' georgringer/news:'^9.2.0' sourcebroker/t3api:'@dev' sourcebroker/t3apinews:'@dev' --no-progress -n -d /var/www/html/$VERSION
15-
16-
vendor/bin/typo3cms install:setup -n --database-name $DATABASE
17-
vendor/bin/typo3cms configuration:set 'BE/debug' 1
18-
vendor/bin/typo3cms configuration:set 'BE/lockSSL' true
19-
vendor/bin/typo3cms configuration:set 'FE/debug' 1
20-
vendor/bin/typo3cms configuration:set 'SYS/devIPmask' '*'
21-
vendor/bin/typo3cms configuration:set 'SYS/displayErrors' 1
22-
vendor/bin/typo3cms configuration:set 'SYS/trustedHostsPattern' '.*.*'
23-
vendor/bin/typo3cms configuration:set 'MAIL/transport' 'smtp'
24-
vendor/bin/typo3cms configuration:set 'MAIL/transport_smtp_server' 'localhost:1025'
25-
vendor/bin/typo3cms configuration:set 'GFX/processor' 'ImageMagick'
26-
vendor/bin/typo3cms configuration:set 'GFX/processor_path' '/usr/bin/'
27-
vendor/bin/typo3cms configuration:set 'GFX/processor_path_lzw' '/usr/bin/'
28-
29-
sed -i -e "s/base: ht\//base: \//g" /var/www/html/$VERSION/config/sites/main/config.yaml
30-
sed -i -e 's/base: \/en\//base: \//g' /var/www/html/$VERSION/config/sites/main/config.yaml
31-
printf "imports:\n -\n resource: 'EXT:$EXTENSION_KEY/Configuration/Routing/config.yaml'" >> /var/www/html/$VERSION/config/sites/main/config.yaml
32-
33-
cp -r "/var/www/html/$EXTENSION_KEY/.ddev/data-init/fileadmin/" "/var/www/html/$VERSION/public/"
34-
mysql -uroot -proot $DATABASE < "/var/www/html/$EXTENSION_KEY/.ddev/data-init/$DATABASE.sql"
35-
36-
vendor/bin/typo3cms database:updateschema
37-
vendor/bin/typo3cms cache:flush
17+
composer init --name=sourcebroker/typo3$VERSION --description=TYPO3$VERSION --no-interaction --working-dir $BASE_PATH
18+
composer config extra.typo3/cms.web-dir public --working-dir $BASE_PATH
19+
composer config repositories.$EXTENSION_KEY path ../$EXTENSION_KEY --working-dir $BASE_PATH
20+
composer req typo3/minimal:'^11.5' helhum/typo3-console:'^7.0' georgringer/news:'^9.2.0' \
21+
sourcebroker/t3api:'@dev' sourcebroker/t3apinews:'@dev' \
22+
--no-progress --no-interaction --working-dir $BASE_PATH
23+
24+
$BASE_PATH/vendor/bin/typo3cms install:setup -n --database-name $DATABASE
25+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'BE/debug' 1
26+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'BE/lockSSL' true
27+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'FE/debug' 1
28+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'SYS/devIPmask' '*'
29+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'SYS/displayErrors' 1
30+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'SYS/trustedHostsPattern' '.*.*'
31+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'MAIL/transport' 'smtp'
32+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'MAIL/transport_smtp_server' 'localhost:1025'
33+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'GFX/processor' 'ImageMagick'
34+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'GFX/processor_path' '/usr/bin/'
35+
$BASE_PATH/vendor/bin/typo3cms configuration:set 'GFX/processor_path_lzw' '/usr/bin/'
36+
37+
sed -i -e "s/base: ht\//base: \//g" $BASE_PATH/config/sites/main/config.yaml
38+
sed -i -e 's/base: \/en\//base: \//g' $BASE_PATH/config/sites/main/config.yaml
39+
printf "imports:\n -\n resource: 'EXT:$EXTENSION_KEY/Configuration/Routing/config.yaml'" >> $BASE_PATH/config/sites/main/config.yaml
40+
41+
cp -r "$BASE_PATH/../$EXTENSION_KEY/.ddev/data-init/fileadmin/" "$BASE_PATH/public/"
42+
mysql -uroot -proot $DATABASE < "$BASE_PATH/../$EXTENSION_KEY/.ddev/data-init/$DATABASE.sql"
43+
44+
$BASE_PATH/vendor/bin/typo3cms database:updateschema
45+
$BASE_PATH/vendor/bin/typo3cms cache:flush

0 commit comments

Comments
 (0)