ddenv
ddenv (Denis’ Developer Environment) is a tool for setting up a local development environment.
Watch the 75-second introduction:
Requirements
First, ensure you have Homebrew installed, and are using a supported shell (zsh, bash, or fish).
Then, run brew install denisdefreyne/tap/ddenv
.
Quick start
Create a .config/ddenv.yaml
or ddenv.yaml
file which contains the list of dependencies to manage. For example:1
up:
- homebrew: overmind
- postgresql:
version: 17
env:
DB_URL: "postgres://{{ .User }}:{{ .Password }}@{{ .Host }}:{{ .Port }}/mydb"
- redis:
env:
REDIS_URL: "redis://{{ .Host }}:{{ .Port }}/0"
- ruby
- bundle
- node
- npm
Then, run ddenv
:
% ddenv
Installing Homebrew package ‘overmind’ skipped
Installing Homebrew package ‘ruby-install’ skipped
Installing Ruby 3.3.6 skipped
Adding Shadowenv to shell skipped
Creating Shadowenv dir done
Adding Shadowenv dir to .gitignore done
Adding Ruby 3.3.6 to Shadowenv done
Installing Ruby gem bundler done
Installing bundle done
Installing Homebrew package ‘node-build’ checking...
Installing Node 20.12.2 pending
Adding Node 20.12.2 to Shadowenv pending
Installing npm packages pending
Now your local developer environment is ready to be used.
Goals
-
homebrew: PACKAGENAME
installs the Homebrew package with the given name. Example:up: - homebrew: overmind
-
ruby
installs Ruby (with the version specified in the.ruby-version
file). Example:up: - ruby
-
bundle
runsbundle install
. Example:up: - ruby - bundle
-
node
installs Node.js (with the version specified in the.node-version
file). Example:up: - node
-
npm
installs packages from package.json using npm. Example:up: - node - npm
-
pnpm
installs packages from package.json using pnpm. Example:up: - node - pnpm
-
yarn
installs packages from package.json using yarn. Example:up: - node - yarn
-
postgresql: …
installs the given version of PostgreSQL (the version key), starts it, and sets up environment variables based on the env key (User
,Password
,Host
andPort
are available as keys). Example:up: - postgresql: version: 17 env: DB_URL: "postgres://{{ .User }}:{{ .Password }}@{{ .Host }}:{{ .Port }}/mydb"
-
redis: …
installs Redis, starts it, and sets up environment variables based on the env key (Host
andPort
are available as keys). Example:up: - redis: env: REDIS_URL: "redis://{{ .Host }}:{{ .Port }}/0"
Footnotes
-
This example relies on a
.ruby-version
file being present, e.g. with the file contents3.3.6
, and a.node-version
file, e.g. with the file contents20.12.2
. ↩