Skip to content

Commit

Permalink
Split dev/test initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
mneudert committed Feb 14, 2025
1 parent 45bc732 commit 05f75d3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
12 changes: 11 additions & 1 deletion .ddev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ This will automatically open the default browser and take you to the Matomo setu

Follow the on-screen instructions in the UI installer to complete the Matomo setup. This will configure the necessary database and settings for your local instance.

### 3. Set up the testing environment
### 3. Set up the development environment

After Matomo is set up, you can initialize the development environment by running:

```
ddev matomo:init:dev
```

This command will set up the environment for development, installing the additional dependencies required.

### 4. Set up the testing environment

After Matomo is set up, you can initialize the testing environment by running:

Expand Down
16 changes: 16 additions & 0 deletions .ddev/commands/host/matomo_init_dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

## Description: Initialize Matomo environment for development
## Usage: matomo:init:dev
## Example: ddev matomo:init:dev

echo "Run npm install ..."
ddev npm install

echo "Enable development mode and disable assets merging ..."
ddev matomo:console development:enable
ddev matomo:console config:set Development.disable_merged_assets=1

echo "Done: Matomo dev setup initialisation finished."
echo ""

12 changes: 1 addition & 11 deletions .ddev/commands/host/matomo_init_tests
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/usr/bin/env bash

## Description: Initialize Matomo environment including tests setup
## Description: Initialize Matomo environment for testing
## Usage: matomo:init:tests
## Example: ddev matomo:init:tests

echo "Running the base init ..."
ddev matomo:init

echo "Run npm install ..."
ddev npm install

echo "Configure test environment ..."
ddev matomo:console config:set \
'database_tests.host="db"' \
Expand All @@ -23,10 +17,6 @@ echo "Copy UI tests config file ..."
echo "@see https://developer.matomo.org/guides/tests-ui#configuring-ui-tests"
ddev exec '\cp .ddev/initial-config/config.js tests/UI/config.js'

echo "Enable development mode and disable assets merging ..."
ddev matomo:console development:enable
ddev matomo:console config:set Development.disable_merged_assets=1

echo "Initialise test database: setup OmniFixture ..."
ddev matomo:console tests:setup-fixture OmniFixture

Expand Down

0 comments on commit 05f75d3

Please sign in to comment.