Deploying
Variflow works in file mode: the token file is in your repository, and each environment builds its own CSS from it. Builds are fast (a 300-token file takes about a tenth of a second on a modern server) and safe: a build with errors never replaces the live CSS.
In a deploy script
After your code is in place:
php system/ee/eecli.php addons:update -a variflow # when you've upgraded Variflow
php system/ee/eecli.php variflow:verify || exit 1 # stop the deploy if the token file has errors
php system/ee/eecli.php variflow:build
variflow:verifychecks the file and compares it with the live build. It writes nothing, and exits non-zero on errors.variflow:buildpublishes. When the output is the same as the live build it publishes nothing ("Unchanged"), so running it on every deploy is free. If the live build's files have gone missing from the output folder, it writes them again.- Queued rename rewrites run by themselves when the build goes live.
variflow:rewrite:rundoes the same on demand.
With MSM, add --site=all to verify and build.
Where the CSS goes
Builds are written to themes/user/variflow-tokens/<site>/ as tokens.<hash>.css, alongside a
manifest (.json, which the control panel and pickers read) and the source it was built from.
- Not in the add-on's theme folder: an upgrade that replaces
themes/user/variflownever deletes live CSS. - Don't commit it. Each environment builds its own. If your deploy wipes
themes/user, either keep that folder between deploys or runvariflow:buildafter it: the build writes the live files back. - Elsewhere: set
$config['variflow_output_dir']and, if it's served from another URL,$config['variflow_output_url'].
Automatic builds
With variflow_auto_build on, the first control panel request after the token file changes runs
a build and shows a banner with the result.
- Development hosts: on by default.
- Elsewhere: off by default.
Production should build from the deploy script, so a broken file is caught there, not by the first editor who logs in.
$config['variflow_auto_build'] = false;
Environments
Paths, the prefix and the output folder come from config.php only, never the database, because
the database travels between local, staging and production while paths differ. Set them per
environment the way you set EE's own paths.
The settings on the Settings page (automatic builds, contrast checks, builds to keep) are stored
per site in the database. A value in config.php always wins over them.
Rolling back
php system/ee/eecli.php variflow:rollback --list
php system/ee/eecli.php variflow:rollback --to=previous
Or Builds › Roll back to #N in the control panel.
- What it does: republishes an earlier build's files without recompiling, so it works even when the current token file is broken.
- How far back: the live build and the five before it keep their files
(
variflow_keep_builds). Older builds stay in the history without files. - Afterwards: roll forward by building again, once the file is fixed.
Checking an environment
php system/ee/eecli.php variflow:doctor
It checks:
- PHP, EE, and the add-on's version and database;
- the token file;
- the output folder, and that the live CSS answers over HTTP;
- the picker assets and the licence;
- queued work.
--bench also times a build of a generated 300-token file, without publishing anything.