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.46.9 lib/takeltau/init/packer/docker.rb
takeltau-0.46.8 lib/takeltau/init/packer/docker.rb
takeltau-0.46.5 lib/takeltau/init/packer/docker.rb
takeltau-0.46.1 lib/takeltau/init/packer/docker.rb
takeltau-0.46.0 lib/takeltau/init/packer/docker.rb
takeltau-0.45.27 lib/takeltau/init/packer/docker.rb
takeltau-0.45.26 lib/takeltau/init/packer/docker.rb
takeltau-0.45.24 lib/takeltau/init/packer/docker.rb
takeltau-0.45.23 lib/takeltau/init/packer/docker.rb
takeltau-0.45.22 lib/takeltau/init/packer/docker.rb
takeltau-0.45.21 lib/takeltau/init/packer/docker.rb
takeltau-0.45.19 lib/takeltau/init/packer/docker.rb
takeltau-0.45.17 lib/takeltau/init/packer/docker.rb
takeltau-0.45.16 lib/takeltau/init/packer/docker.rb
takeltau-0.45.14 lib/takeltau/init/packer/docker.rb
takeltau-0.45.13 lib/takeltau/init/packer/docker.rb
takeltau-0.45.12 lib/takeltau/init/packer/docker.rb
takeltau-0.45.11 lib/takeltau/init/packer/docker.rb
takeltau-0.45.10 lib/takeltau/init/packer/docker.rb
takeltau-0.45.9 lib/takeltau/init/packer/docker.rb