Class: Fastlane::FirebaseTestLab::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/firebase_test_lab/helper/storage.rb

Instance Method Summary collapse

Constructor Details

#initialize(gcp_project, credential) ⇒ Storage

Returns a new instance of Storage.



11
12
13
14
15
# File 'lib/fastlane/plugin/firebase_test_lab/helper/storage.rb', line 11

def initialize(gcp_project, credential)
  credentials = credential.get_google_credential(GCS_OAUTH_SCOPES)
  @client = Google::Cloud::Storage.new(project_id: gcp_project,
                                       credentials: credentials)
end

Instance Method Details

#upload_file(source_path, destination_bucket, destination_path) ⇒ Object



17
18
19
20
# File 'lib/fastlane/plugin/firebase_test_lab/helper/storage.rb', line 17

def upload_file(source_path, destination_bucket, destination_path)
  bucket = @client.bucket(destination_bucket)
  bucket.create_file(source_path, destination_path)
end