Sha256: 54562acc7f96ac7237546eec3c4c3c68e347adfd4122b55d81934ae1a03b0ff2

Contents?: true

Size: 904 Bytes

Versions: 19

Compression:

Stored size: 904 Bytes

Contents

module Vpsb
  module Resources
    class AppBagsJson < BaseResource
      res :app_bags_json

      def call(data)
        template(data)
      end

      private

      def template(data)
        {
          id: "webapps",
          apps_base_dir: "/opt/www",
          apps: [
            {
              name: data.get(:app_name),
              type: "rails",
              default_env:  "production",
              host: data.get(:app_host),
              try_files: "/caches/$uri.html",
              nginx: {
                default: true,
                nginx_use_ssl: false
              },
              unicorn: {
                unicorn_workers: data.get(:unicorn_worker_processes),
                unicorn_timeout: data.get(:unicorn_worker_timeout)
              },
              app_env_variables: data.get(:app_env_variables)
            }
          ]
        }
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
vpsb-1.1.8 lib/vpsb/resources/app_bags_json.rb
vpsb-1.1.7 lib/vpsb/resources/app_bags_json.rb
vpsb-1.1.6 lib/vpsb/resources/app_bags_json.rb
vpsb-1.1.5 lib/vpsb/resources/app_bags_json.rb
vpsb-1.1.4 lib/vpsb/resources/app_bags_json.rb
vpsb-1.1.3 lib/vpsb/resources/app_bags_json.rb
vpsb-1.1.2 lib/vpsb/resources/app_bags_json.rb
vpsb-1.1.1 lib/vpsb/resources/app_bags_json.rb
vpsb-1.1.0 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.9 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.8 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.7 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.6 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.5 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.4 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.3 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.2 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.1 lib/vpsb/resources/app_bags_json.rb
vpsb-1.0.0 lib/vpsb/resources/app_bags_json.rb