Sha256: 2dc603415392be4a91947c4d733b1208757db101b550da6bfbe2a9ea6d968f08

Contents?: true

Size: 985 Bytes

Versions: 3

Compression:

Stored size: 985 Bytes

Contents

# Example
# =======
#
# tire_setup_settings:
#   url: "http://localhost:9200"

Capistrano::Configuration.instance(:must_exist).load do
  set(:tire_remote_file) { File.join(shared_path, 'config/tire.yml') } unless exists?(:tire_remote_file)
  set(:tire_template, 'tire.yml.erb') unless exists?(:tire_template)

  # Required attributes
  # ===================
  # *url* http://localhost:9200
  namespace :tire do
    namespace :setup do
      desc "Upload configs"
      task :default, :roles => :app do
        if exists?(:tire_setup_settings)
          set :recipe_settings, fetch(:tire_setup_settings, {})
          put template.render(fetch(:tire_template)), fetch(:tire_remote_file)
        else
          puts "[FATAL] - Tire template settings were not found"
          abort
        end
      end

      desc "Download configs"
      task :get, :roles => :db do
        download fetch(:tire_remote_file), File.join(local_rails_root, "config/tire.yml")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
marcosgz-cap-recipe-0.0.8 lib/capistrano/recipes/tire.rb
marcosgz-cap-recipe-0.0.7 lib/capistrano/recipes/tire.rb
marcosgz-cap-recipe-0.0.6 lib/capistrano/recipes/tire.rb