Skip to content

Annertech/annertech-ddev

Repository files navigation

DDEV Annertech Tools

Highly opinionated set of configs and commands used by Annertech in our DDEV workflow.

Installation and Updating

  1. ddev add-on get annertech/annertech-ddev
  2. git commit -m 'Add annertech/annertech-ddev addon'

Features

Automatically disabled

are automatically disabled in local environment to facilitate development.

Automatically identified and configured

If your Drupal projects depend on ImageMagick then DDEV will be automatically configured to compile and use ImageMagick v7 in DDEV. See scripts/ddev/web-build for details.

Platform.sh is using v7 while DDEV is still running v6 by default.

Automated Tests for a Project

Use ddev tests to see what test suites are available for each project.

Environment Indicators

Environment indicators in the Drupal Toolbar are tricky because we need to ensure that colors don't conflict with each other and also work with white text.

The following colors should be used:

Color HEX Contrast Environment
local #4A0080 13:1 local, ddev
dev #005B94 7:1 dev
stage #59590D 7:1 stage
live #8B0000 10:1 production

This is what people with color vision deficiency see when using the above colors:

Environment Indicator color palette

Note

Please note that the add-on only controls the local environment color. You must fix the rest yourself!

Upsun config for SimpleI environment indicator

// Per environment settings:
// Configure environment indicator (simplei)
if (isset($platformsh->branch)) {
  // Production type environment.
  if ($platformsh->branch == 'main' || $platformsh->onDedicated()) {
    $settings['simple_environment_indicator'] = '#8B0000 LIVE';
  }
  // Staging type environment
  else if ($platformsh->branch == 'stage') {
    $settings['simple_environment_indicator'] = '#59590D STAGE';
  }
  // Development type environment.
  else {
    $settings['simple_environment_indicator'] = '#005B94 DEV';
  }
}
    

Teamwork Integration

Several commands integrate with Teamwork (comment, timelog, open-issue, timew). These require the following environment variables to be set on your host machine:

export TEAMWORK_DOMAIN="projects.yourcompany.com"
export TEAMWORK_API_KEY="your_api_key_here"

Add these to your ~/.bashrc or ~/.zshrc file.

Tricks

Handy shell aliases to add to your host machine:

# DDEV
alias composer='ddev composer'
alias behat='ddev behat'
alias drush='ddev drush'
alias platform='ddev platform'
alias upsun='ddev upsun'
alias robo='ddev robo'

alias xe='ddev xdebug enable'
alias xd='ddev xdebug disable'
alias xt='status=$(ddev xdebug status) &&  if [ "$status" == "xdebug enabled" ]; then ddev xdebug off; else ddev xdebug on; fi' 

Common Problems and How-To Fix Them

commit-msg hook is ignored

Check git config -l for the value of core.hooksPath and can change it to the local path with

git config --local core.hooksPath .git/hooks

About

A set of opinionated tools and configurations for DDEV

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 10