Sha256: bc920c154899b59ec17c42d1b0fa0e8f1878ff9726c935b59912bf329c70c2ce

Contents?: true

Size: 793 Bytes

Versions: 10

Compression:

Stored size: 793 Bytes

Contents

# frozen_string_literal: true

namespace :figaro_yml do
  include Capistrano::Ops::FigaroYml::Paths
  include Capistrano::Ops::FigaroYml::Helpers
  task :create_local do
    run_locally do
      puts "found #{stages.count} stages"
      yamls_combined = {}

      stages.each do |f|
        stage = File.basename(f, '.rb')
        puts "download #{stage} application.yml"
        begin
          res = capture "cap #{stage} figaro_yml:get_stage"
          stage_yaml = YAML.safe_load(res)
          stage_yaml[stage.to_s] = stage_yaml[stage.to_s].sort.to_h
          yamls_combined.merge!(stage_yaml) if stage_yaml
        rescue StandardError
          puts "could not get #{stage} application.yml"
        end
      end

      write_combined_yaml(yamls_combined.sort.to_h)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
capistrano-ops-1.0.9 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.8 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.7 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.6 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.5 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.4 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.3 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.2 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.1 lib/capistrano/ops/figaro_yml/tasks/create_local.rake
capistrano-ops-1.0.0 lib/capistrano/ops/figaro_yml/tasks/create_local.rake