Sha256: a358d8b076f8d0db65e2cdef674a14b8ab60398ed961a3dcd388a72cda76610b

Contents?: true

Size: 689 Bytes

Versions: 23

Compression:

Stored size: 689 Bytes

Contents

if system.runs_service?("apache2") && system.has_file?("/usr/bin/rails")
  apache_vhosts = system["unmanaged_files"].files.select { |f| /vhosts\.d/ =~ f.name }.map(&:name)
  apache_vhosts.each do |vhost|
    rails_env = system.read_config(vhost, "PassengerAppEnv")
    rails_public = system.read_config(vhost, "DocumentRoot")

    if rails_env && !rails_env.empty? && /public/.match(rails_public)
      identify "rails", "web"
      parameter "ports", ["3000:3000"]
      parameter "links", ["db"]
      rails_root = File.join(rails_public.gsub(/\/public/, ""), "")
      extract rails_root, "data"
      break # for now we only handle the first rails app that was found
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
machinery-tool-1.24.1 workload_mapper/rails/clue.rb
machinery-tool-1.24.0 workload_mapper/rails/clue.rb
machinery-tool-1.23.1 workload_mapper/rails/clue.rb
machinery-tool-1.23.0 workload_mapper/rails/clue.rb
machinery-tool-1.22.3 workload_mapper/rails/clue.rb
machinery-tool-1.22.2 workload_mapper/rails/clue.rb
machinery-tool-1.22.1 workload_mapper/rails/clue.rb
machinery-tool-1.22.0 workload_mapper/rails/clue.rb
machinery-tool-1.21.0 workload_mapper/rails/clue.rb
machinery-tool-1.20.0 workload_mapper/rails/clue.rb
machinery-tool-1.19.0 workload_mapper/rails/clue.rb
machinery-tool-1.18.0 workload_mapper/rails/clue.rb
machinery-tool-1.17.0 workload_mapper/rails/clue.rb
machinery-tool-1.16.4 workload_mapper/rails/clue.rb
machinery-tool-1.16.3 workload_mapper/rails/clue.rb
machinery-tool-1.16.2 workload_mapper/rails/clue.rb
machinery-tool-1.16.1 workload_mapper/rails/clue.rb
machinery-tool-1.16.0 workload_mapper/rails/clue.rb
machinery-tool-1.15.0 workload_mapper/rails/clue.rb
machinery-tool-1.14.2 workload_mapper/rails/clue.rb