Module: R10K::CLI::Deploy

Defined in:
lib/r10k/cli/deploy.rb

Defined Under Namespace

Modules: Display, Environment, Module

Class Method Summary collapse

Class Method Details

.commandObject



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
# File 'lib/r10k/cli/deploy.rb', line 13

def self.command
  @cmd ||= Cri::Command.define do
    name    'deploy'
    usage   'deploy <subcommand>'
    summary 'Puppet dynamic environment deployment'

    description <<-DESCRIPTION
`r10k deploy` implements the Git branch to Puppet environment workflow
(https://puppetlabs.com/blog/git-workflow-and-puppet-environments/).
    DESCRIPTION

    required nil, :cachedir, 'Specify a cachedir, overriding the value in config'
    flag nil, :'no-force', 'Prevent the overwriting of local module modifications'
    flag nil, :'generate-types', 'Run `puppet generate types` after updating an environment'
    option nil, :'puppet-path', 'Path to puppet executable', argument: :required do |value, cmd|
      unless File.executable? value
        $stderr.puts "The specified puppet executable #{value} is not executable."
        puts cmd.help
        exit 1
      end
    end

    run do |opts, args, cmd|
      puts cmd.help(:verbose => opts[:verbose])
      exit 0
    end
  end
end