Skip to content

Commit

Permalink
devcontainer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Nov 18, 2023
1 parent 6d6587e commit 64dc770
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM mcr.microsoft.com/devcontainers/php:8.2
RUN apt update && apt install -y libicu-dev libz-dev libzip-dev vim
RUN apt update && apt install -y libicu-dev libz-dev libzip-dev vim mariadb-client
RUN docker-php-ext-install bcmath intl zip pdo_mysql
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
]
}
},
"postCreateCommand": "composer install && ./bin/post-clone.sh && cp -R tests/fixtures/project/ config/project/ && php craft install --username=admin [email protected] --password=secret --siteName=pest --siteUrl=http://localhost:8080 --language=en-US && ./bin/post-install.sh"
"postCreateCommand": "composer install && ./bin/post-clone.sh && cp .env.example .env && php craft install --username=admin [email protected] --password=secret --siteName=pest --siteUrl=http://localhost:8080 --language=en-US && ./bin/post-install.sh"
}
23 changes: 8 additions & 15 deletions bin/post-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,14 @@ if ! grep -q "CRAFT_RUN_QUEUE_AUTOMATICALLY=false" .env.example; then
echo "" >> .env
fi

if [ ! -f "config/app.php" ]; then
mkdir -p config
echo "<?php return [
'components' => [
'queue' => [
'class' => \yii\queue\sync\Queue::class,
'handle' => true, // if tasks should be executed immediately
],
],
'bootstrap' => [
function (\$app) {
(new \\markhuot\\craftpest\\Pest)->bootstrap(\$app);
},
]
];" > config/app.php
if ! grep -q "CRAFT_TEMPLATES_PATH=./tests/templates" .env.example; then
echo "" >> .env
echo "CRAFT_TEMPLATES_PATH=./tests/templates" >> .env.example
echo "" >> .env
fi

if [ ! -d "config" ]; then
cp -r stubs/config ./
fi

if [ ! -d "web" ]; then
Expand Down
1 change: 0 additions & 1 deletion bin/post-install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash

php craft plugin/install keystone
php ./bin/create-default-fs.php > /dev/null 2>&1

0 comments on commit 64dc770

Please sign in to comment.