Class: DPL::Provider::Firebase

Inherits:
DPL::Provider show all
Defined in:
lib/dpl/provider/firebase.rb

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from DPL::Provider

apt_get, #cleanup, #commit_msg, context, #create_key, #default_text_charset, #default_text_charset?, #deploy, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn

Constructor Details

This class inherits a constructor from DPL::Provider

Instance Method Details

#check_appObject



10
11
12
# File 'lib/dpl/provider/firebase.rb', line 10

def check_app
  error "missing firebase.json" unless File.exist? "firebase.json"
end

#check_authObject

Raises:



6
7
8
# File 'lib/dpl/provider/firebase.rb', line 6

def check_auth
  raise Error, "must supply token option or FIREBASE_TOKEN environment variable" if !options[:token] && !context.env['FIREBASE_TOKEN']
end

#needs_key?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/dpl/provider/firebase.rb', line 14

def needs_key?
  false
end

#push_appObject



18
19
20
21
22
23
# File 'lib/dpl/provider/firebase.rb', line 18

def push_app
  command = "firebase deploy --non-interactive"
  command << " -f #{options[:project]}" if options[:project]
  command << " --token '#{options[:token]}'" if options[:token]
  context.shell command
end