Add support for bare puppet modules to puppet-lint

puppet-lint expects the parent folder where the test is executed
to be named after (or ends with) the module name.

If the folder isn't named correctly, puppet-lint raises an error:

    "XXX not in autoload module layout on line YY".

This change adds support for bare puppet module projects by creating
a symbolic link named after the project pointing to the sources and
changing the current directory to it. The project name is expected
to end with the actual module name for it to work.

If a "modules" folder is found, nothing is done. We suppose
the project is using a multi-modules layout and puppet-lint runs fine
against this kind of layout.

Change-Id: Id9e8a7edb8d64046e6e57aa4c161a9947edc25d9
Reviewed-on: https://review.openstack.org/35069
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Mathieu Gagné 2013-06-30 18:35:34 -04:00 committed by Jenkins
parent 36b917b1e0
commit 64d2e15fb5

View File

@ -65,7 +65,12 @@
- builder:
name: puppet-lint
builders:
- shell: "rake lint"
- shell: |
test -d modules || {
ln -s . {project}
cd {project}
}
rake lint
- builder:
name: puppet-syntax