Class: Fastlane::FirebaseAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_account.rb

Class Method Summary collapse

Class Method Details

.activate_service_account_with_key_file(key_file_path) ⇒ Object



3
4
5
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_account.rb', line 3

def self.(key_file_path)
  Fastlane::Actions.sh('gcloud', 'auth', 'activate-service-account', '--key-file', key_file_path)
end

.auth_status_dataObject

Lookup the current account authentication status



15
16
17
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_account.rb', line 15

def self.auth_status_data
  Fastlane::Actions.sh('gcloud', 'auth', 'list', '--format', 'json', log: false)
end

.authenticated?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_account.rb', line 7

def self.authenticated?
  auth_status = JSON.parse(auth_status_data)
  auth_status.any? do ||
    ['status'] == 'ACTIVE'
  end
end