Skip to content
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

ERB suffix handling #114

Merged
merged 3 commits into from
Apr 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ Style/HashSyntax:
# dealbreaker:
Style/TrailingCommaInLiteral:
Enabled: false

# would require external library
Style/IndentHeredoc:
Enabled: false
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## ??? - 0.8.0

Prefer `.erb` suffixes on template files, and do not use the `.erb` suffix in configuration keys. To convert your moduleroot directory, run

```
find moduleroot/ -type f -exec git mv {} {}.erb \;
```

in your configs repository. Configuration keys in `config_defaults.yml`, and `.sync.yml` need to be handled by hand.

ATTENTION: If you were using `.erb`-suffixed keys in your `config_defaults.yml` file, this will break your config.

## 2017-02-13 - 0.7.2

Fixes an issue releasing 0.7.1, no functional changes.
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Puppet Labs module engineers manage the zoo of Puppet modules on GitHub, and
has now been restructured and generalized to be used within other
organizations. Puppet modules within an organization tend to have a number of
meta-files that are identical or very similar between modules, such as the
Gemfile, .travis.yml, .gitignore, or spec\_helper.rb. If a file needs to
`Gemfile`, `.travis.yml`, `.gitignore`, or `spec\_helper.rb`. If a file needs to
change in one module, it likely needs to change in the same way in every other
module that the organization manages.

Expand Down Expand Up @@ -60,22 +60,24 @@ of this configuration directory. [The configuration for the Puppet Labs
modules](https://github.com/puppetlabs/modulesync\_configs), can be used as an
example for your own configuration. The configuration directory contains a
directory called moduleroot which mirrors the structure of a module. The files
in the moduleroot could be flat files or ERB templates. The templates are
rendered using values from a file called config\_defaults.yml in the root (not
in the moduleroot are ERB templates, and MUST be named after the target file,
with `.erb.` appended. The templates are
rendered using values from a file called `config\_defaults.yml` in the root (not
moduleroot) of the configuration directory. The default values can be
overridden or extended by adding a file called .sync.yml to the module itself.
overridden or extended by adding a file called `.sync.yml` to the module itself.
This allows us to, for example, have a set of "required" gems that are added
to all Gemfiles, and a set of "optional" gems that a single module might add.

Within the templates, values can be accessed in the `@configs` hash, which is
merged from the values under the keys `:global` and the current file name.
merged from the values under the keys `:global` and the target file name (no
`.erb` suffix).

The list of modules to manage is in managed\_modules.yml in the configuration
The list of modules to manage is in `managed\_modules.yml` in the configuration
directory. This lists just the names of the modules to be managed.

ModuleSync can be called from the command line with parameters to change the
branch you're working on or the remote to clone from and push to. You can also
define these parameters in a file named modulesync.yml in the configuration
define these parameters in a file named `modulesync.yml` in the configuration
directory.

Installing
Expand Down Expand Up @@ -122,6 +124,7 @@ msync update --noop
```

#### Offline support

The --offline flag was added to allow a user to disable git support within
msync. One reason for this is because the user wants to control git commands
external to msync. Note, when using this command, msync assumes you have
Expand Down Expand Up @@ -359,6 +362,5 @@ As commented, files within moduleroot directory can be flat files or ERB templat
The Templates
-------------

See the [modulesync\_configs](https://github.com/puppetlabs/modulesync_configs)
repository for an explanation of the templates that Puppet Labs uses on its
modules.
See [Puppet's modulesync\_configs](https://github.com/puppetlabs/modulesync_configs) and [Vox Pupuli's modulesync\_configs](https://github.com/voxpupuli/modulesync_configs)
repositories for different templates currently in use.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Cucumber::Rake::Task.new do |t|
t.cucumber_opts << '--format pretty'
end

task :test => [:clean, :spec, :cucumber, :rubocop]
task :test => %i[clean spec cucumber rubocop]
Loading