Class: ReleaseManager::DeployModCli

Inherits:
Object
  • Object
show all
Defined in:
lib/release_manager/cli/deploy_mod_cli.rb

Class Method Summary collapse

Class Method Details

.runObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/release_manager/cli/deploy_mod_cli.rb', line 6

def self.run
  options = {}
  OptionParser.new do |opts|
    opts.program_name = 'deploy-mod'
    opts.version = ReleaseManager::VERSION
    opts.on_head("\nSummary: Gets the version of your module found in the metadata\n         and populates the r10k-control Puppetfile with the updated\n         tag version. Revmoes any branch or ref reference and replaces\n         with tag.  Currently it is up to you to commit and push the Puppetfile change.\n\n    EOF\n    )\n    opts.on('-p', \"--puppetfile [PUPPETFILE]\", 'Path to R10k Puppetfile, defaults to ~/repos/r10k-control/Puppetfile') do |p|\n      options[:puppetfile] = p\n    end\n    opts.on('-m', '--modulepath [MODULEPATH]', \"Path to to module, defaults to: \#{Dir.getwd}\") do |p|\n      options[:modulepath] = p\n    end\n    opts.on('-c', '--commit', 'Optionally, Commit the Puppetfile change') do |p|\n      options[:commit] = p\n    end\n    # removing this option as it seems a little dangerous for now\n    # opts.on('-u', '--push', 'Optionally, Push the changes to the remote') do |p|\n    #   options[:push] = p\n    # end\n    # opts.on('-r', '--remote REMOTE', 'Optionally, specify a remote name or url to push changes to') do |p|\n    #   options[:remote] = p\n    # end\n    opts.on('-d', 'Perform a dry run without making changes') do |p|\n      options[:dry_run] = p\n    end\n  end.parse!\n  m = ModuleDeployer.new(options)\n  m.run\nend\n"