In this article you will learn what blueprints are in Sail CLI, how to apply them and how to write your own.
Blueprints in Sail are YAML files, which define the environment, where the WordPress application is provisioned. This can include things like non-default plugins, themes, options, constants, as well as additional server software and configuration.
To apply a blueprint, run:
sail blueprint path/to/blueprint.yaml
You can apply a blueprint during init
as well:
sail init --blueprint path/to/blueprint.yaml
Blueprints allow developers to define custom variables. Sail will either prompt for these variables, or look for them on the command line interface. For example:
options:
blogname: ${{ blogname }}
vars:
name: blogname
prompt: What is your site name
option: --blogname
default: Just another WordPress site
This will cause an interactive prompt when applying the blueprint, unless the value for that variable is passed in using the --blogname option on the command line:
sail blueprint path/to/blueprint.yaml --blogname="My New Blog"
Note: Some blueprints will create files and directories on your production server. It is highly recommend to sail download to make sure your working copy is in sync.
As mentioned above, a blueprint is a YAML file, which can consist of one or more of the following sections:
Use the sample.yaml to learn about each of these sections.
Sail ships with some sample and common blueprints, available in the blueprints directory:
If you need help applying an existing blueprint or writing your own, please visit our getting help section.