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
$ ssh [email protected] whoami
Deploying your first environment
Navigate to the root of any ddev-powered project and run:
$ bash <(curl -fsSL mayfly.live/preview.sh)
Mayfly will spin up the environment under your account subdomain and print a shareable URL.
Accessing your container
Mayfly allows SSH access to the individual DDEV containers should you need to rsync assets or alter code on the fly
$ 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.
$ cat dump.sql | bash <(curl -fsSL mayfly.live/preview.sh) import-db
.sql or sql.gz