Sha256: a9a9d9ec9021198f7a8183f7df272d8dfe39a4e94f66db1bd4b25d17a6a783f6

Contents?: true

Size: 1.83 KB

Versions: 4

Compression:

Stored size: 1.83 KB

Contents

# frozen_string_literal: true

module Takeltau
  # takeltau init packer
  class InitPacker < SubCommandBase
    include Thor::Actions
    include LoggingModule
    include SystemModule
    include ConfigModule
    include ProjectModule
    include GitCheckClean
    include GitCheckWorkspace
    include InitLib
    include InitPackerDocker

    argument :name

    # Define templates
    # rubocop:disable Metrics/MethodLength
    def initialize(args = [], local_options = {}, configuration = {})
      # initialize thor parent class
      super args, local_options, configuration

      @ansiblelint = {
        name: 'ansible/.ansible-lint',
        template: 'templates/ansiblelint.tt'
      }
      @gitignore = {
        name: '.gitignore',
        template: '../templates/gitignore.tt'
      }
      @groupvarsprojectyml = {
        name: 'ansible/group_vars/all/project.yml',
        template: 'templates/groupvarsprojectyml.tt'
      }
      @hgclone = {
        name: 'hgclone',
        template: 'templates/hgclone.tt'
      }
      @playbooksiteyml = {
        name: 'ansible/playbook-site.yml',
        template: 'templates/playbooksiteyml.tt'
      }
      @projectyml = {
        name: 'project.yml',
        template: 'templates/projectyml.tt'
      }
      @rakefile = {
        name: 'Rakefile',
        template: '../templates/Rakefile.tt'
      }
    end
    # rubocop:enable Metrics/MethodLength

    # Provide template path for Thor:Actions
    def self.source_root
      File.dirname(__FILE__)
    end

    #
    # init packer docker
    #
    desc 'docker [NAME]', 'Initialize packer project [NAME] for docker images'
    long_desc <<-LONGDESC.gsub("\n", "\x5")
    Initialize packer project [NAME] for docker images
    LONGDESC
    # Initialize packer project [NAME] for docker images.
    def docker
      exit init_packer_docker
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
takeltau-0.35.15 lib/takeltau/init/packer/cli.rb
takeltau-0.35.14 lib/takeltau/init/packer/cli.rb
takeltau-0.35.12 lib/takeltau/init/packer/cli.rb
takeltau-0.35.11 lib/takeltau/init/packer/cli.rb