-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run via jenkins complains about autoload module layout #361
Comments
Please double check that the name of the directory to which Jenkins checks your code out matches the name of the Puppet module. |
This is what we did at StackForge for our puppet modules for OpenStack: We parse Modulefile or metadata.json, create a folder with the module name, rsync files in it and run puppet-lint from that new folder. |
@cdenneen Is this still an issue for you? If so, can you update to 2.0.0 and see if that resolves it? Thank you. |
I'm getting this issue with Atlassian Bamboo, when performing the following steps:
sh "puppet-lint manifests --error-level error --no-2sp_soft_tabs-check" When I SSH into the Bamboo box and cd into the set working directory and run puppet-lint, it completes without errors. Looks like something strange is going on with the path recognition... |
@drewhemm When you run the test interactively, are you just running I don't have a working Jenkins or Bamboo installation to test with myself. |
Seems I needed to add the --relative flag for it to work. |
@drewhemm your Jenkins test step is now: sh "puppet-lint manifests --relative --error-level error --no-2sp_soft_tabs-check" And it works properly? Can we close this now? |
Confirmed. I've attached my Rakefile which is now working from Bamboo after adding --relative. I imagine the same solution applies to Jenkins |
Awesome, thanks so much for the update Andrew! @cdenneen I'm closing this out but if you can confirm at your leisure that you were able to resolve your issue with Jenkins that would be great. Thanks! |
@rnelson0 puppet-lint 0.3.2 this works fine without any special change. Creating a custom Rake task (most modules will use rspec helpers to have default rake tasks), probably isn't really a "fix" (Does work in a custom scenario):
However the relative fix is configurable and does make v2.0.0 work so just want to explain here how that works if someone else stumbles upon this post:
or something like
Thanks @drewhemm for discovering this and @rnelson0 for the follow-ups. |
This is the default when using |
I can't seem to reproduce this locally but it happens via Jenkins.
I've installed same rvm version locally but still no issues linting.
-bash-4.1$ bundle exec rake lint
manifests/exampleservice.pp - ERROR: exampleservice::exampleservice not in autoload module layout on line 19
manifests/init.pp - ERROR: exampleservice not in autoload module layout on line 19
rake aborted!
/var/lib/jenkins/.rvm/gems/ruby-2.0.0-p481/gems/puppet-lint-0.3.2/lib/puppet-lint/tasks/puppet-lint.rb:25:in
'block (2 levels) in initialize' /var/lib/jenkins/.rvm/gems/ruby-2.0.0-p481/gems/puppet-lint-0.3.2/lib/puppet-lint/tasks/puppet-lint.rb:13:in
block in initialize'/var/lib/jenkins/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in
eval' /var/lib/jenkins/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in
Tasks: TOP => lint
(See full trace by running task with --trace)
Using this repo to test:
https://github.com/myoung34/puppet-exampleservice
I end up having to add the following to Rakefile in order to get Jenkins to successfully build:
PuppetLint.configuration.send('disable_autoloader_layout')
The text was updated successfully, but these errors were encountered: