Object
Creates a new DeploymentMetadata instance for the given deployment_datetime.
If the file doesn't exist, create it and set the defaults.
If the file does exist, load it from disk.
# File lib/openshift-origin-node/model/deployment_metadata.rb, line 44 def initialize(container, deployment_datetime) @file = PathUtils.join(container.container_dir, 'app-deployments', deployment_datetime, 'metadata.json') if File.exist?(@file) load else File.new(@file, "w", 0o0644) container.set_rw_permission(@file) @metadata = defaults save end end
# File lib/openshift-origin-node/model/deployment_metadata.rb, line 69 def as_json(options={}) { git_ref: @metadata[:git_ref], git_sha1: @metadata[:git_sha1], id: @metadata[:id], hot_deploy: @metadata[:hot_deploy], force_clean_build: @metadata[:force_clean_build], activations: @metadata[:activations], checksum: @metadata[:checksum] } end
# File lib/openshift-origin-node/model/deployment_metadata.rb, line 59 def load File.open(@file, "r") do |f| @metadata = HashWithIndifferentAccess.new(JSON.load(f)) end end
Generated with the Darkfish Rdoc Generator 2.