Conventions
mstrap makes decisions while trying to adhere to a series of conventions.
The following is a rough outline of those conventions and when they can be
deviated from during the course of an mstrap run:
init- Creates runtime configuration directory
- Installs/updates cURL CA bundle
- Downloads/updates copy of strap or strap-linux
- If it doesn’t exist, creates a Brewfile for the default profile.
- Many of the dependencies in the Brewfile are required for the operation of other mstrap steps.
dependencies- Install mise, if
miseis enabled as the default runtime manager. - Run
straporstrap-linux. This will:- (macOS only) Set security defaults
- Install OS updates.
- Install necessary development tools
- Setup your Git user
- If you have a
dotfilesrepo for your GitHub user, it will clone it and runscript/setup, if it exists. - If you have a
homebrew-Brewfilerepo for your GitHub user, it will clone it and runbrew bundlewith it. - If you have a
.Brewfilein your home directory, it will runbrew bundlewith it. - If it cloned your
dotfilesrepo and it has ascript/strap-after-setup, it will be run.
- Reload profiles (in case dotfiles scripts installed/changed some)
- Run
brew bundlefor all loaded profiles and theirBrewfile
- Install mise, if
shell- Injects a shell script loader (e.g.
source ~/.mstrap/env.shin Bash) into the current running shell’s configuration to loadmstrapand variousmstrap-related environment variables on load.
- Injects a shell script loader (e.g.
services- If any profiles (or
mstrapinternally) have any active services defined via aservices.yml, the containers will be (re)created.
- If any profiles (or
projects- If there are any web projects, an NGINX container will be created. This will attempt to install Docker if it’s not installed already.
- For each project:
- The project will be cloned or updated.
- If it already exists and there are active changes, the changes will be autostashed and restored while it is updated and bootstrapped.
- The project will be bootstrapped.
- If the project has a
script/bootstrapand/orscript/setup, they will be run, unless this has been disabled at the project config level (run_scripts = false). - Otherwise,
mstrapwill guess which runtimes it uses, and do standard operations like: installing theasdformiseplugin for the language, installing the version of the language runtime (if specified by the project), and installing dependencies via the language runtime’s package manager. - If the project is a web project, an NGINX configuration will be
created for the project.
- If
mkcertis installed, it will setup TLS certs for the NGINX site as well.
- If
- The project will be cloned or updated.
runtimes- If there are configured runtimes, it sets the global version to the latest installed version.
- If there are any global packages specified, it installs them for all installed versions of the language runtime.