Raised: $0
0% of monthly goal Help us cross the finish line!
Goal: $12,000
Raised: $0 Goal: $12,000
0% of monthly goal Help us cross the finish line!
Sponsor DDEV

add-on registry tests last commit release

DDEV Site Devkit

Overview

DDEV Site Devkit standardises everyday project tasks across multiple repositories while keeping each project in control of its own logic.

This add-on adds a set of first-class DDEV commands that orchestrate common site workflows such as scaffolding, authentication, build, synchronisation, installation, and testing, as well as switching between development and production modes. Some workflows provide both frontend and backend variants.

The heavy lifting lives in project-owned scripts under .ddev/site-devkit/site/scripts, so teams can customise behaviour per project without forking the add-on.

What you get

Install or update

ddev add-on get colinstillwell/ddev-site-devkit
ddev restart

After installing or updating, commit the changes this add-on makes under .ddev. In most cases these are in .ddev/site-devkit and .ddev/commands.

Usage

There are two types of commands provided by this add-on:

ddev devkit-* commands

Command Description
devkit-config-diff Compare config and report keys present in reference but missing in target
devkit-config-get Get a config value by name from a given format and location
devkit-db-import Interactively import an SQL dump into the project database
devkit-drupal-search-api-index Index Drupal Search API indexes
devkit-file-copy Copy a file from source to destination within the project, skipping if it already exists
devkit-log Print a formatted log message
devkit-minio-create-bucket Create a MinIO bucket if it does not exist, and set its policy
devkit-prompt Prompt the user for input
devkit-script-run Run a script on the host or in a specified service
devkit-typesense-delete-collections Delete Typesense collections

ddev site-* commands

Command Description Examples
site-auth Authentication tasks Authenticate SSH keys
site-build Build tasks Wraps tasks for the backend and frontend
site-build-backend Backend build tasks Composer install
site-build-frontend Frontend build tasks NPM install
site-install Installation tasks Wraps tasks for the backend and frontend
site-install-backend Backend installation tasks New project installs the application; existing project builds and syncs
site-install-frontend Frontend installation tasks New project installs the application; existing project builds and syncs
site-mode-development Enable development mode Disable caches, enable verbose logging
site-mode-production Enable production mode Enable caches, aggregate CSS and JS
site-scaffold Scaffolding tasks Copy required files, set permissions
site-sync Synchronisation tasks Wraps tasks for the backend and frontend
site-sync-backend Backend synchronisation tasks Database import, public files
site-sync-frontend Frontend synchronisation tasks Images, compiled CSS and JS
site-test Testing tasks Wraps tasks for the backend and frontend
site-test-backend Backend testing tasks Unit, kernel, integration
site-test-frontend Frontend testing tasks Unit, end to end

Customising the generated scripts

When you install this add-on, example scripts are copied into your project at .ddev/site-devkit/site/scripts.

Each ddev site-* command maps 1:1 to a script in that directory. These scripts are yours to edit and should be committed to your repository.

If your project doesn’t need frontend or backend scripts, just leave them unused. They’ll reappear on update if deleted.

How to modify

  1. Open the matching script.
  2. Remove the #ddev-generated line (this prevents the script being replaced on update).
  3. Remove the ## Script provided by https://github.com/colinstillwell/ddev-site-devkit. line.
  4. Keep the shebang and safety flags:
    #!/usr/bin/env bash
    
    # Exit on error; treat unset variables as errors; fail pipelines if any command fails
    set -euo pipefail
    
  5. Replace the placeholder content with your project’s logic.
  6. Use the ddev devkit-* commands provided by this add-on where useful.

Update behaviour

When you update the add-on, any script that still has #ddev-generated will be overwritten. Once you remove that line, the script is considered project-owned and will not be touched.

To reset a script back to the example, delete it from your project and reinstall the add-on. A fresh copy will be generated.

Resources

Contributing

  1. Work from an issue. If none exists, create one first.
  2. Branch from main using issue/<number>-<short-slug> in lowercase with hyphens.
  3. Make your changes and commit with the prefix [<number>].
  4. Add or update tests in tests as needed.
  5. Update README.md as needed.
  6. Push your branch and open a pull request on GitHub.

Testing branch or PR

# Branch
ddev add-on get https://github.com/colinstillwell/ddev-site-devkit/tarball/<branch>

# Pull request
ddev add-on get https://github.com/colinstillwell/ddev-site-devkit/tarball/refs/pull/<pr-number>/head

Release

Create a release on GitHub:

Credits

Contributed and maintained by @colinstillwell