Provisioning Brev Environments
In this guide, we show you how you can setup shareable and fully-configurable dev environments for a team of devs.
We'll walk through the process of creating an environment from scratch. To get started, create a new environment from the Brev console, or just hit this link.
1. Add the Project Git Repo
Each environment has a primary git repo for the project that will be cloned into an environment's home directory automatically. You can populate it in the git repositories section:
2. Configure Hardware
Choose the default hardware for the environment. Keep in mind that this is not set in stone: users can change the hardware their env runs on with either brev scale in the CLI or in the env settings page in the Console.
Optionally, connect your cloud
You can add your AWS account to Brev to keep the instances in your cloud.
Click the "Connect AWS" button on the Org Settings page to deploy a CloudFormation stack enabling Brev to create EC2s in your cloud.
3. Create a Setup Script
The crux of a Brev environment is the setup script. It runs on any environment's first boot and gives each user the exact same environment. Setup scripts can either go in the same repo as the project or in a separate repo.
The reason we use bash scripts over something like Docker is that they are ubiquitous (if you use Docker primarily you can always call it from a bash script)
If you're not coming from dev environments that don't use setup scripts, we recommend populating your setup script incrementally as you run each env setup command and then testing the script as a whole on a new environment.
4. Populate the Environment Variables
Environment variables can be configured at org level, environment level or for at personal level. In the Settings tab, you can setup environment variables for an organization and personal environment variables can be configured in settings under the profile icon.
5. Share the Environment
Brev environments by default are shareable: each user in an org will automatically get access to their team's environment templates in the Templates tab. Org members can clone those environments and start developing right away.