puppetinabox / controlrepo

39 stars 23 forks source link

Paths #59

Closed vladgh closed 8 years ago

vladgh commented 8 years ago

These are more questions rather than issues, but the files seem a bit scattered inside this repo. You have a Gemfile in the root of the repo, but the Rakefile and spec folders are all inside the dist/profile/? Wouldn't it make more sense to put all these files into one place (either the root or the profile)? If the latter, would it be advantageous to move 'profile' and 'role' into individual modules, hosted in their own repositories, with their own testing?

rnelson0 commented 8 years ago

@vladgh There are specific reasons for that.

Gemfile: This should be at the root of a git repository for bundler to work Rakefile: This should be where the user runs "rake test" from. This is dist/profile because that is the module you are testing, and the puppetlabs_spec_helper tasks expect the filesystem layout that you find within a module, not at the top of the controlrepo. Module locations: I originally had the modules separated but consolidated them. I explained my reasoning at http://rnelson0.com/2015/04/15/improved-r10k-deployment-patterns/. Since then, Gary Larizza (Puppet Labs PSE) has described this as a best practice at http://garylarizza.com/blog/2015/11/16/workflows-evolved-even-besterer-practices/

It seems like perhaps some documentation within the repo or wiki would help with this, rather than expecting everyone to read my blog. To help me generate that documentation to address the underlying issues best, can you help me out by explaining why you asked these questions? Were you exploring the file layout, watching the commit logs, trying to perform a task and running into issues, etc?

Thanks!

vladgh commented 8 years ago

Gary's article was in fact the reason I was asking, because the puppetlabs/control-repo is rather bare and lacks any sort of testing (for now). I completely agree that they should both reside inside the main repo. When I was exploring the layout, for some reason I thought that you are going in the other direction (separating them again :smile:) I see that's not the case. In my control repo I ended up putting the Gemfile inside dist/profile as well and calling the travis build like:

sudo: false

language: ruby

install: 'cd dist/profile && bundle install --without development'

matrix:
  fast_finish: true
  include:
  - rvm: 2.1.7
    env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES=yes
    script: 'bundle exec rake test'
  - rvm: default
    sudo: required
    services: docker
    env: BEAKER_set="ubuntu-14-04-x64"
    script: 'bundle exec rake acceptance'
  - rvm: default
    sudo: required
    services: docker
    env: BEAKER_set="debian-8-2-x64"
    script: 'bundle exec rake acceptance'

This changes the directory to dist/profile and runs the tests (unit tests in the new dockerized travis infrastructure and acceptance tests in the legacy one, inside which docker is installed).

Anyway, I digress. Thank you for clarifying this.

rnelson0 commented 8 years ago

@vladgh I am going to close this out as I think we both understand each other now. If you see room for improvement in the docs, please feel free to update the wiki directly, or open a ticket if you need assistance or want another pair of eyes on it. Thanks!