xorpaul/g10k

Add option to git clone local copy of repos instead of git archive | untar

DavidGamba opened this issue · 5 comments

This is related to #93 but the use case is to allow a local copy of the entire r10k module repos so that developers can work locally.

When using a development puppet master we then sync our changes to the puppet master and verify that they work.

Having a local clone is very helpful and currently we have a script that parses the Puppetfile and clones the repos but doesn't support all syntaxes. It would be great if g10k can support this.

Check out https://github.com/xorpaul/g10k/releases/tag/v0.8.9
and add clone_git_modules: true to your g10k config.

Then you should get a cloned git repository with the correct referenced module branch to your g10k basedir.

Thanks for the instructions and for implementing the feature. I have a ticket in my backlog to test it out.

Thanks for the awesome work with g10k. It enables us to work without any ruby dependencies since we are not a ruby shop, and it is fast!

@xorpaul how can I use this feature while also using -puppetfile?
I tried having both -puppetfile and -config with only that but they seem to be mutually exclusive.

Same sentiment here. My use case in the original #93 sounds similar to what is requested here: The puppet coders clone the control repo, get the branch they want, run g10k to get a copy of the modules so they can easily get a full view of the environment, and now they need to easily make changes to the module they are working on and make commits.

Ideally we want to have cloning work in Puppetfile mode, but it doesn't seem to be trivial.

The clone_git_modules: true option works with both a puppetfile and a config file when the config points to the repo where the puppetfile lives:

            cat <<EOL > "${dir}/r10k.yaml"
---
:cachedir: /tmp/r10k/cache
:clone_git_modules: true
:sources:
  puppet:
    basedir: ${dir}
    prefix: false
    remote: 'git@repo:path/puppet-r10k.git'
    exit_if_unreachable: true
EOL

            ./bin/g10k -verbose -tags -branch ${r10k_branch_name} -config ${dir}/r10k.yaml