The possibility to validate yaml files in TYPO3.Flow by using a Schema file is a really nice feature. But to be honest, who is validating his configuration manually after each change he made? Exactly! No one.
Putting this into Jenkins to be made in each build process is easy, but the problem is, that Jenkins only fails if he gets an exit code greater than zero. So I decided to write a small shell script that runs the command for me and that returns an exit 0 if everything is validated and an exit 1 if there are errors.
Here is the shell script, perhaps it helps someone else:
# Usage: (From document root) ./validateSchema.sh <Context>
# Context for example: Production
for i in Settings YourOtherSettings SpecialSettings; do
echo "Validating configuration $i for context $context"
result=`FLOW_CONTEXT=$context ./flow configuration:validate --type $i`
if [[ $result == *error* ]]; then
echo "Validation failed"
There are two parameters required. The first one tells the script for which context it should validate the yaml files, the second parameter tells the script where the flow installation is located so that it can run the flow command.
For me it was enough to just add the different settings in the for loop, but this script can be changed with no effort to add a third parameter and to add the different types of settings as the third parameter.