Sha256: 5077230a6405b161a9d9f6b7f85b0a017583beab1192fd34ec567d6609ce87a0

Contents?: true

Size: 1.25 KB

Versions: 45

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

# takeltau init packer docker
module InitPackerDocker
  # Backend method for init docker packer.
  # @return [Boolean] successful init?
  def init_packer_docker
    log.debug 'Initialize packer project for docker images'

    files = _init_packer_docker_files_get

    return false unless _init_packer_docker_check_prerequisites files

    exit_code = _init_packer_docker_create_project files

    # reinitialize config with newly created files
    initialize_config ''

    return false unless _init_lib_hg_clone

    return false unless exit_code

    true
  end

  private

  # Add templates.
  def _init_packer_docker_files_get
    [
      @gitignore,
      @groupvarsprojectyml,
      @hgclone,
      @playbooksiteyml,
      @projectyml,
      @rakefile
    ]
  end

  # Check prerequisites.
  def _init_packer_docker_check_prerequisites(files)
    return false unless _init_lib_git_check

    return false unless _init_lib_files_check files

    true
  end

  # Create project.
  def _init_packer_docker_create_project(files)
    exit_code = true

    exit_code &&= _init_lib_git_init
    exit_code &&= _init_lib_files_create files
    exit_code &&= _init_lib_git_add_all
    exit_code &&= _init_lib_git_commit_initial

    exit_code
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
takeltau-0.45.8 lib/takeltau/init/packer/docker.rb
takeltau-0.45.6 lib/takeltau/init/packer/docker.rb
takeltau-0.45.5 lib/takeltau/init/packer/docker.rb
takeltau-0.45.4 lib/takeltau/init/packer/docker.rb
takeltau-0.45.3 lib/takeltau/init/packer/docker.rb
takeltau-0.45.2 lib/takeltau/init/packer/docker.rb
takeltau-0.45.0 lib/takeltau/init/packer/docker.rb
takeltau-0.44.42 lib/takeltau/init/packer/docker.rb
takeltau-0.44.41 lib/takeltau/init/packer/docker.rb
takeltau-0.44.39 lib/takeltau/init/packer/docker.rb
takeltau-0.44.37 lib/takeltau/init/packer/docker.rb
takeltau-0.44.36 lib/takeltau/init/packer/docker.rb
takeltau-0.44.35 lib/takeltau/init/packer/docker.rb
takeltau-0.44.29 lib/takeltau/init/packer/docker.rb
takeltau-0.44.27 lib/takeltau/init/packer/docker.rb
takeltau-0.44.24 lib/takeltau/init/packer/docker.rb
takeltau-0.44.23 lib/takeltau/init/packer/docker.rb
takeltau-0.44.19 lib/takeltau/init/packer/docker.rb
takeltau-0.44.18 lib/takeltau/init/packer/docker.rb
takeltau-0.44.15 lib/takeltau/init/packer/docker.rb