Configuration - waffle-ops/waffle GitHub Wiki
To take full advantage of Waffle, you will need a .waffle.yml
configuration file. This is a simple YAML file that tells Waffle how your project is configured so that it can work with your project.
You can create a basic .waffle.yml
file by running the init
command.
Below is a description of the various configuration items that Waffle will accept.
alias
Example:
alias: mycoolproject
The alias
is synonymous with a Drush alias. Wordpress sites on Pantheon also support work here.
If your Drush alias is normally @mycoolproject.prod
, you only need to provide mycoolproject
here.
bin
Example:
bin:
drush: 'lando drush'
npm: 'lando npm'
gulp: 'lando gulp'
The bin
config item allows you to alter the way that Waffle calls external tools. In the example above,
any time Waffle would make a drush
call, it will prefix it with lando
(ie drush cr
=> lando drush cr
).
All cli tools supported by Waffle can use this system (composer, drush, git, gulp, compass, npm, symfony, wp, etc...)
Note: This system can also allow you to target different versions of tools. If you had both composer 1.x and composer 2.x
installed and they exist on your path as composer1
and composer
, respectively. Then you could use:
bin:
composer: 'composer1'
to route all composer calls from Waffle to Composer 1.x.
build-backend
Example:
build-backend:
strategy: composer
If defined, Waffle will use this as the defaults for the build-backend
task.
build-frontend
Example:
build-frontend:
strategy: gulp
dir: path/to/your/theme
If defined, Waffle will use this as the default for the build-frontend
task.
Currently supported strategy
options are gulp
and compass
*.
- Note - when using
compass
, Waffle assumes thatgem install
has already run.
cms
Example:
cms: drupal8
This is for the cms the project is using. Currently, drupal7
, drupal8
, and wordpress
are supported.
You can add other values here as well such as custom
or laravel
. However, you will be responsible for providing your own tasks and recipes if you choose to do so as the preconfigured tasks and recipes only support Drupal and Wordpress.
default_upstream
Example:
default_upstream: prod
This is the default upstream environment that Waffle will use when performing tasks and recipes that need access to higher environments.
If your host
configuration is set to pantheon
this will default to live
. Otherwise, this will default to prod
.
The default_upstream
value must exist under upstreams
.
environment-variables
Example:
environment-variables:
COMPOSER_MEMORY_LIMIT: 1G
SOME_OTHER_VARIABLE: 'some_value'
TODO
host
Example:
host: acquia
This is for the hosting provider of the project is using. Currently, acquia
, and pantheon
are supported.
You can add other values here as well such as custom
or platformsh
. However, you will be responsible for providing your own tasks and recipes if you choose to do so as the preconfigured tasks and recipes only support Acquia and Pantheon.
recipes
Example:
tasks:
recipe: "../private/slack.sh"
Recipes are collections of tasks.
Custom recipes defined here can override default tasks provided by Waffle. For example, if you have a Drupal 8 site, you could override the default site-sync
recipe by adding something like:
recipes:
site-sync:
- sync-db: {--upstream=dev}
- sync-files: {--upstream=prod}
- login: {}
Note: Default tasks (such as sync-files
) and any custom tasks defined in the tasks
section of the config file can be used in a recipe. See the tasks
section for more details.
tasks
Example:
tasks:
notify-slack: "../private/slack.sh"
test-phpcs: ../private/tests/phpcs.sh
Tasks are references to local scripts that are needed to build your project. Any tasks defined here will appear under the the Avaliable Tasks
section in the list
command.
Custom task defined here can override default tasks provided by Waffle. For example, if you have a Drupal 8 site, you could override the default sync-db
task by adding something like:
tasks:
sync-db: "../my/custom/db-sync.sh"
Note: Overridden tasks override the tasks everywhere in the scope of the project. A task that is overridden that is used in a recipe will use the task as defined in you .waffle.yml
file.
Custom tasks can also override recipes provided by Waffle. You can override a recipe by defining a task with the same command key. For example, to override the site-sync
recipe, you could define:
tasks:
site-sync: "../my/custom/site-sync.sh"
upstreams
Example:
upstreams: dev, test, prod, live
These are the upstream environments that you want Waffle to interact with.