A utility for validating a sites.yml
file on a Pantheon site during a WordPress multisite's search and replace tasks. For more information, see Pantheon's Multisite Docs.
To validate the sites.yml
file, run:
$ sites-yml-validator sites path/to/sites.yml
See this annotated fixture for an example of a valid sites.yml
file.
The basic format for the file is:
api_version: 1
domain_maps:
{env_name}:
{site_id}: {site_url}
A sites.yml
file is valid if:
- the
api_version
is1
convert_to_subdirectory
is a booleantrue
orfalse
, or the integers1
or0
.- the key for each item in
domain_maps
is a valid Pantheon environment name (dev
,test
,multidev
, etc.) - For each site listed for an environment:
- the key is an integer
- the value is a valid Pantheon hostname
- there are no more than 25 sites listed for any environment
Use wget to download, gzipped pre-compiled binaries:
For instance, VERSION=v0.0.11 and BINARY=sites-yml-validator_linux_amd64
Refer to the Releases page for VERSION
and BINARY
parameters
wget https://github.com/pantheon-systems/sites-yml-validator/releases/download/${VERSION}/${BINARY}.tar.gz -O - |\
tar xz && mv ${BINARY} /usr/bin/sites-yml-validator
wget https://github.com/pantheon-systems/sites-yml-validator/releases/download/${VERSION}/${BINARY} -O /usr/bin/sites-yml-validator &&\
chmod +x /usr/bin/sites-yml-validator
wget https://github.com/pantheon-systems/sites-yml-validator/releases/latest/download/sites-yml-validator_linux_amd64 -O /usr/bin/sites-yml-validator &&\
chmod +x /usr/bin/sites-yml-validator
curl -LO https://github.com/pantheon-systems/sites-yml-validator/releases/latest/download/sites-yml-validator_Darwin_x86_64.tar.gz && tar -xf sites-yml-validator_Darwin_x86_64.tar.gz && sudo mv sites-yml-validator /usr/local/bin/sites-yml-validator && sudo chmod +x /usr/local/bin/sites-yml-validator
curl -LO https://github.com/pantheon-systems/sites-yml-validator/releases/latest/download/sites-yml-validator_Darwin_arm64.tar.gz && tar -xf sites-yml-validator_Darwin_arm64.tar.gz && sudo mv sites-yml-validator /usr/local/bin/sites-yml-validator && sudo chmod +x /usr/local/bin/sites-yml-validator
make test
runs linting and testing.
Automatically releases on merge to main via autotag + goreleaser. See Autotag Readme for details on how the SemVer is determined. With goreleaser, each commit merged will become a line item in the release's Changelog. Take note to use squashing and/or rebase to ensure helpful and informative commit messages.