Getting Started

Getting Started with Mayfly

Mayfly gives you on-demand preview environments powered by ddev. Deploy a fresh copy of your site for every merge request, share the URL with your team, and let it disappear when you're done.

Prerequisites

  • ddev installed and configured on your local machine
  • An SSH key pair — Mayfly uses your public key for authentication
  • A Mayfly account (free during beta — join via Slack)

Setup

Sign up is via a private beta over Slack.

Once you join, Mike should be in touch - he'll need the following details to set you up with an account:

  • Account name - generally your company name - this will be part of the preview URLs
  • SSH Keys - The public SSH keys of those using your account, this can be as many as you need but will generally include your CI server

Once the account is set up, you can run the following to confirm everything works

bash
$ ssh [email protected] whoami

Deploying your first environment

Navigate to the root of any ddev-powered project and run:

bash
$ bash <(curl -fsSL mayfly.live/preview.sh)

Mayfly will spin up the environment under your account subdomain and print a shareable URL.

Tip: Each environment is named after your ddev project name and a hash of your current branch. Run the same command on a different branch and you'll get a second, independent environment — both live at the same time.

Accessing your container

Mayfly allows SSH access to the individual DDEV containers should you need to rsync assets or alter code on the fly

bash
$ ssh -t [email protected] <SLUG>

Where {SLUG} is the Mayfly's unique preview code.

Importing a database

If you wish to import a database, the `preview.sh` file allows standard input for passing your SQL file.

bash
$ cat dump.sql | bash <(curl -fsSL mayfly.live/preview.sh) import-db
Tip: The database file can be .sql or sql.gz