Sha256: 498b4ec8939a15268fce1ad7121fc87e072b48604b1f52168bbeec406bb5f7e0

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

# Wrapper method for quickly loading, rendering ERB templates
# and uploading them to the server.
def template(from, to)
  erb = File.read(File.expand_path("../templates/#{from}", __FILE__))
  put ERB.new(erb).result(binding), to
end

# Wrapper method to set default values for recipes.
def set_default(name, *args, &block)
  set(name, *args, &block) unless exists?(name)
end

# Review and modify the tasks below on a per-app/language/framework basis.
namespace :deploy do
  after "deploy:update_code", "deploy:post"
  desc "Performs the post-deploy tasks."
  task :post do
    symlinks
    migrate
    assets
  end

  desc "Performs an Active Record migration."
  task :migrate do
    run "cd '#{release_path}' && #{env} rake db:migrate"
  end

  desc "Precompiles assets from Rails' asset pipeline."
  task :assets do
    run "cd '#{release_path}' && #{env} rake assets:precompile"
  end

  desc "Sets up additional symlinks after deploy."
  task :symlinks do
    # Exmaple:
    # run "ln -nfs '#{shared_path}/db/production.sqlite3' '#{release_path}/db/production.sqlite3'"
  end

  after "deploy:setup", "deploy:setup_shared"
  desc "Sets up additional folders/files after deploy:setup."
  task :setup_shared do
    run "mkdir -p '#{shared_path}/config'"
  end

  desc "Restarts the app server."
  task :restart do
    # Example:
    # restart_torquebox_app
    # restart_upstart_app
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
negroku-0.0.1 lib/negroku/tasks/base.rb