lib/engineyard-metadata/chef_dna.rb in engineyard-metadata-0.1.1 vs lib/engineyard-metadata/chef_dna.rb in engineyard-metadata-0.1.2
- old
+ new
@@ -10,10 +10,12 @@
module Metadata
# An adapter that reads from /etc/chef/dna.json, which is only available on cloud instances.
class ChefDna
PATH = '/etc/chef/dna.json'
+ include SshAliasHelper
+
def data # :nodoc:
@data ||= ActiveSupport::JSON.decode File.read(PATH)
end
# The present instance's role
@@ -43,10 +45,27 @@
# The git repository that you told EngineYard to use for this application.
def repository_uri
data['engineyard']['environment']['apps'][0]['repository_name']
end
-
+
+ # The name of the single app that runs in this environment.
+ #
+ # Warning: this gem currently doesn't support multiple apps per environment.
+ def app_name
+ data['engineyard']['environment']['apps'][0]['name']
+ end
+
+ # The path to the current deploy on app servers.
+ def current_path
+ "/data/#{app_name}/current"
+ end
+
+ # The path to the shared directory on app servers.
+ def shared_path
+ "/data/#{app_name}/shared"
+ end
+
# Public hostname where you should connect to the database.
#
# Currently the db master public hostname.
def database_host
db_master