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
mise
is enabled as the default runtime manager. - Run
strap
orstrap-linux
. This will:- (macOS only) Set security defaults
- Install OS updates.
- Install necessary development tools
- Setup your Git user
- If you have a
dotfiles
repo for your GitHub user, it will clone it and runscript/setup
, if it exists. - If you have a
homebrew-Brewfile
repo for your GitHub user, it will clone it and runbrew bundle
with it. - If you have a
.Brewfile
in your home directory, it will runbrew bundle
with it. - If it cloned your
dotfiles
repo and it has ascript/strap-after-setup
, it will be run.
- Reload profiles (in case dotfiles scripts installed/changed some)
- Run
brew bundle
for all loaded profiles and theirBrewfile
- Install mise, if
shell
- Injects a shell script loader (e.g.
source ~/.mstrap/env.sh
in Bash) into the current running shell’s configuration to loadmstrap
and variousmstrap
-related environment variables on load.
- Injects a shell script loader (e.g.
services
- If any profiles (or
mstrap
internally) 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/bootstrap
and/orscript/setup
, they will be run, unless this has been disabled at the project config level (run_scripts = false
). - Otherwise,
mstrap
will guess which runtimes it uses, and do standard operations like: installing theasdf
ormise
plugin 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
mkcert
is 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.