diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-02-07 21:14:04 +0000 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-02-07 22:19:16 +0000 |
commit | 62ae61ed96005c42d3de597a0c8b17f233e46f2e (patch) | |
tree | 8983ec78738136e38706be09ec0b33f78816b20e /lib | |
parent | 8abdabdb3ad9e4b87893f24042de077cd4a7d791 (diff) | |
download | gitlab-ce-62ae61ed96005c42d3de597a0c8b17f233e46f2e.tar.gz |
CI runs lint on shell scripts in lib/supportjej-lint-scripts-and-config
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/config_lint.rake | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/tasks/config_lint.rake b/lib/tasks/config_lint.rake new file mode 100644 index 00000000000..ddbcf1e1eb8 --- /dev/null +++ b/lib/tasks/config_lint.rake @@ -0,0 +1,25 @@ +module ConfigLint + def self.run(files) + failures = files.reject do |file| + yield(file) + end + + if failures.present? + puts failures + exit failures.count + end + end +end + +desc "Checks syntax for shell scripts and nginx config files in 'lib/support/'" +task :config_lint do + shell_scripts = [ + 'lib/support/init.d/gitlab', + 'lib/support/init.d/gitlab.default.example', + 'lib/support/deploy/deploy.sh' + ] + + ConfigLint.run(shell_scripts) do |file| + Kernel.system('bash', '-n', file) + end +end |