Sha256: f9b27292a2f3adfefa716c3cf644b1212db1d2d34dc9ccc80a77ba841afb568e

Contents?: true

Size: 1.23 KB

Versions: 6

Compression:

Stored size: 1.23 KB

Contents

namespace :deploy do

  namespace :check do

    task :application do

      on roles(:app) do
        sudo :mkdir, "-p", deploy_to, shared_path.join("config")
        sudo :chown, "-R", fetch(:user), deploy_to, shared_path.join("config")
      end

      invoke "deploy:application:secrets"
      invoke "deploy:application:web"
      invoke "deploy:application:indexer"
      invoke "deploy:application:db"
      invoke "deploy:application:proxy"
    end

  end

  namespace :application do

    task :secrets do

      on roles(:app) do
        env = StringIO.new
        gc_settings = {
          "RUBY_HEAP_MIN_SLOTS" => 800000,
          "RUBY_FREE_MIN" => 100000,
          "RUBY_GC_MALLOC_LIMIT" => 59000000
        }

        fetch(:secrets, {}).merge(gc_settings).each_pair do |key,value|
          env.puts "export #{"#{key}".upcase}='#{Shellwords.shellescape(value)}'"
        end
        env.rewind

        upload! env, shared_path.join(".env")
        yaml = StringIO.new({ "#{fetch(:framework_env)}" => fetch(:secrets, {}) }.to_yaml)

        upload! yaml, shared_path.join("config/secrets.yml")

      end

    end


  end

end

before "deploy:symlink:linked_files", "check:application"
before "deploy:check:directories", "check:application"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
capistrano-cluster-0.0.16 tasks/deploy/application.rake
capistrano-cluster-0.0.15 tasks/deploy/application.rake
capistrano-cluster-0.0.14 tasks/deploy/application.rake
capistrano-cluster-0.0.13 tasks/deploy/application.rake
capistrano-cluster-0.0.12 tasks/deploy/application.rake
capistrano-cluster-0.0.11 tasks/deploy/application.rake