class Vpsb::Resources::AppBagsJson

Public Instance Methods

call(data) click to toggle source
# File lib/vpsb/resources/app_bags_json.rb, line 6
def call(data)
  template(data)
end

Private Instance Methods

template(data) click to toggle source
# File lib/vpsb/resources/app_bags_json.rb, line 12
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