Open rocketeerbkw opened 4 months ago
The entire structure of these files needs to be tweaked, and this is part of the work for moving more and more into go
PR #289 does some work to remove some of the shyaml. That PR still leaves the shyaml check for the git_sha there, but I think it can actually be removed if you read the comment I've left in the file.
There is currently a validation step for
.lagoon.yml
but it doesn't happen before the build tool needs to parse information from the file. In the case where a user has committed a malformed file (like using tabs instead of spaces) the build will fail with a cryptic error message:I think we should be able to do the validation step as the very first thing, before there are any calls to parse the file. This would be right after the git checkout and before the first
shyaml
call https://github.com/uselagoon/build-deploy-tool/blob/dbd45d20e6939de67d298a364d1cf10ee8ec87d1/legacy/build-deploy.sh#L43-L45Can our validator give a more useful error message about where in the yaml file the error is? Even if it can't, at least having the error put into the section that says
There are issues with your .lagoon.yml file that must be fixed.
would be an improvement.Additionally, we might also move the storing of the
.lagoon.yml
pre-deploy configmap before the validaton step? Then lagoon administrators would be able to look at the file in the case of an error.