Class: GoogleCloudPlatform

Inherits:
Object
  • Object
show all
Defined in:
lib/infrastructure/google_cloud_platform/google_cloud_platform.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_name, app_name, credentials) ⇒ GoogleCloudPlatform



5
6
7
8
9
10
# File 'lib/infrastructure/google_cloud_platform/google_cloud_platform.rb', line 5

def initialize(project_name, app_name, credentials)
    @project_name = project_name
    @app_name = app_name
    @storage = Gcloud.storage "#{project_name}" "#{credentials}"
    @bucket = self.get_bucket
end

Class Method Details

.get_yaml_filename(duty, latest = false) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/infrastructure/google_cloud_platform/google_cloud_platform.rb', line 12

def self.get_yaml_filename(duty, latest=false)
    branch = `git rev-parse --abbrev-ref HEAD`.strip
    commit = 'latest'
    unless latest
        commit = `git rev-parse --short HEAD`.strip
    end

    return "#{@app_name}-#{branch}-#{commit}_#{duty}.yaml"
end