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
43
# 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\nOptions:\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    opts.on('-d', 'Perform a dry run without making changes') do |p|\n      options[:dry_run] = p\n    end\n    opts.on('-a', '--auto', 'Run this script without interaction') do |c|\n      options[:auto] = c\n    end\n    opts.on('-r', '--remote-deploy', \"Perform a remote deploy (For CI systems)\") do |c|\n      options[:remote] = c\n      options[:auto] = true\n    end\n  end.parse!\n  m = ModuleDeployer.new(options)\n  m.run\nend\n"