Sha256: 2ff4c2f4ad91e0e4225d6e70404b557c57ba9226a8f6ad5396743665ae5d9a62

Contents?: true

Size: 1.47 KB

Versions: 8

Compression:

Stored size: 1.47 KB

Contents

class DeploySpec
  class FileSystem < DeploySpec
    include PypiDiscovery
    include RubygemsDiscovery
    include CapistranoDiscovery
    include BundlerDiscovery

    def initialize(app_dir, env)
      @app_dir = Pathname(app_dir)
      @env = env
    end

    def cacheable
      DeploySpec.new(cacheable_config)
    end

    private

    def cacheable_config
      (config || {}).deep_merge(
        'ci' => {'hide' => hidden_statuses, 'allow_failures' => soft_failing_statuses},
        'machine' => {'environment' => machine_env, 'directory' => directory},
        'review' => {
          'checklist' => review_checklist,
          'monitoring' => review_monitoring,
          'checks' => review_checks,
        },
        'plugins' => plugins,
        'dependencies' => {'override' => dependencies_steps},
        'deploy' => {'override' => deploy_steps, 'variables' => deploy_variables.map(&:to_h)},
        'rollback' => {'override' => rollback_steps},
        'fetch' => fetch_deployed_revision_steps,
        'tasks' => cacheable_tasks,
      )
    end

    def cacheable_tasks
      (config('tasks') || {}).map { |k, c| [k, coerce_task_definition(c)] }.to_h
    end

    def config(*)
      @config ||= load_config
      super
    end

    def load_config
      read_config(file("shipit.#{@env}.yml")) || read_config(file('shipit.yml'))
    end

    def read_config(path)
      SafeYAML.load(path.read) if path.exist?
    end

    def file(path)
      @app_dir.join(path)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shipit-engine-0.4.10 app/models/deploy_spec/file_system.rb
shipit-engine-0.4.9 app/models/deploy_spec/file_system.rb
shipit-engine-0.4.8 app/models/deploy_spec/file_system.rb
shipit-engine-0.4.7 app/models/deploy_spec/file_system.rb
shipit-engine-0.4.6 app/models/deploy_spec/file_system.rb
shipit-engine-0.4.5 app/models/deploy_spec/file_system.rb
shipit-engine-0.4.4 app/models/deploy_spec/file_system.rb
shipit-engine-0.4.3 app/models/deploy_spec/file_system.rb