At Intechnic we're using the
DeploymentHelper class to deploy project changes on the staging/live servers. The helper itself is safe to use in CLI environment because it returns proper exit codes.
One problem though, when an SQL error happens not inside the "project_upgrades.sql" file, but during language pack import (which internally rebuilds unit config cache), then this error doesn't cause the deployment process to fail and reports 0 (success) exit code back.
Because of this all CI servers using that deployment script won't fail in case of such error.