Syntax linting for init scripts
What
Adds a rake task for linting shell scripts, which is ran as a job from .gitlab-ci.yml
.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/27787
Why
When bringing GitLab Pages to CE we had a repeat regression breaking the init script, as mentioned in https://gitlab.com/gitlab-org/gitlab-ce/issues/27787
Potential improvements
- At the moment it only checks for syntax errors, but could be improved by using shellcheck. Using shellcheck would show a lot of warnings on
lib/support/init.d/gitlab
currently. - I wasn't able to include nginx configuration linting as
nginx -t -c /path/to/file
only works for the main nginx config file. Attempt is in https://gitlab.com/gitlab-org/gitlab-ce/commit/c73ac0f649adf67c1b3a4789c28c614ad3475f7d