Sha256: e33f0754477a6f19f21722628328d69441e8af578cd12d4210b39365ea00ddd6

Contents?: true

Size: 807 Bytes

Versions: 11

Compression:

Stored size: 807 Bytes

Contents

require 'fileutils'

module Popito
  class StagePreparing
    attr_accessor :config_payload

    def initialize(config_payload)
      self.config_payload = config_payload
    end

    def create_deployer_folder(stage:)
      config_payload.included_files = Popito::IncludedFiles.new(config_payload: config_payload).included_files_list
      Popito::ArchiveDownloading.new(config_payload: config_payload).download_and_extract(stage: stage)
      docker_ajusts if config_payload.stages.include?('build')
    end

    private

    def docker_ajusts
      return unless File.exist?("#{config_payload.build_path}/.dockerignore")

      File.open("#{config_payload.project_path}/.dockerignore", 'a') do |file|
        file.write File.read("#{config_payload.build_path}/.dockerignore")
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
popito-0.0.11.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.10.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.9.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.8.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.7.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.6.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.5.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.4.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.3.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.2.alpha lib/popito/deployer/stage/stage_preparing.rb
popito-0.0.1.alpha lib/popito/deployer/stage/stage_preparing.rb