dpl-firebase 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b986c2c98c3b87bdd8eef12724678881bbd61bea
4
+ data.tar.gz: 63f341db84095cd8502b32a5f25c1409928ac3b6
5
+ SHA512:
6
+ metadata.gz: 2a4c82e88c56d4bec991b474a18a3522c46a5e73fa3d1265491dadb8b29d152324abc34096b4b2f09c279c9ba4973ba6787f2405c0cb8391e6011a1f1ab024cb
7
+ data.tar.gz: 1eba9aaacb5b8d64476d8515ca3ea7d0a6c8c793b5a6b26f6527e6b11b8d3d9ed718cb11781e07391b3c93d114ecf3f716ad3520533550037df5c2be0596045c
@@ -0,0 +1,3 @@
1
+ require './gemspec_helper'
2
+
3
+ gemspec_for 'firebase'
@@ -0,0 +1,27 @@
1
+ module DPL
2
+ class Provider
3
+ class Firebase < Provider
4
+ npm_g 'firebase-tools@^3.0', 'firebase'
5
+
6
+ def check_auth
7
+ raise Error, "must supply token option or FIREBASE_TOKEN environment variable" if !options[:token] && !context.env['FIREBASE_TOKEN']
8
+ end
9
+
10
+ def check_app
11
+ error "missing firebase.json" unless File.exist? "firebase.json"
12
+ end
13
+
14
+ def needs_key?
15
+ false
16
+ end
17
+
18
+ def push_app
19
+ command = "firebase deploy --non-interactive"
20
+ command << " --project #{options[:project]}" if options[:project]
21
+ command << " --message '#{options[:message]}'" if options[:message]
22
+ command << " --token '#{options[:token]}'" if options[:token]
23
+ context.shell command
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+ require 'dpl/provider/firebase'
3
+
4
+ describe DPL::Provider::Firebase do
5
+ subject :provider do
6
+ described_class.new DummyContext.new, :token => 'abc123'
7
+ end
8
+
9
+ describe "#check_auth" do
10
+ it 'should require a token if no FIREBASE_TOKEN is set' do
11
+ provider.options.update(:token => nil)
12
+ expect{ provider.check_auth }.to raise_error("must supply token option or FIREBASE_TOKEN environment variable")
13
+ end
14
+
15
+ it 'should allow no token if FIREBASE_TOKEN is set' do
16
+ provider.options.update(:token => nil)
17
+ provider.context.env['FIREBASE_TOKEN'] = 'abc123'
18
+ expect{ provider.check_auth }.not_to raise_error
19
+ end
20
+ end
21
+
22
+ describe "#push_app" do
23
+ it 'should include the project specified' do
24
+ provider.options.update(:project => 'myapp-dev')
25
+ expect(provider.context).to receive(:shell).with("firebase deploy --non-interactive --project myapp-dev --token 'abc123'")
26
+ provider.push_app
27
+ end
28
+
29
+ it 'should include the message specified' do
30
+ provider.options.update(:message => 'test message')
31
+ expect(provider.context).to receive(:shell).with("firebase deploy --non-interactive --message 'test message' --token 'abc123'")
32
+ provider.push_app
33
+ end
34
+
35
+ it 'should default to no project override' do
36
+ expect(provider.context).to receive(:shell).with("firebase deploy --non-interactive --token 'abc123'")
37
+ provider.push_app
38
+ end
39
+ end
40
+ end
metadata ADDED
@@ -0,0 +1,159 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dpl-firebase
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.9.0
5
+ platform: ruby
6
+ authors:
7
+ - Konstantin Haase
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dpl
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.9.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec-its
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: json_pure
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: tins
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: highline
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: deploy tool abstraction for clients
126
+ email: konstantin.mailinglists@googlemail.com
127
+ executables: []
128
+ extensions: []
129
+ extra_rdoc_files: []
130
+ files:
131
+ - dpl-firebase.gemspec
132
+ - lib/dpl/provider/firebase.rb
133
+ - spec/provider/firebase_spec.rb
134
+ homepage: https://github.com/travis-ci/dpl
135
+ licenses:
136
+ - MIT
137
+ metadata: {}
138
+ post_install_message:
139
+ rdoc_options: []
140
+ require_paths:
141
+ - lib
142
+ required_ruby_version: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '2.2'
147
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ requirements: []
153
+ rubyforge_project:
154
+ rubygems_version: 2.6.13
155
+ signing_key:
156
+ specification_version: 4
157
+ summary: deploy tool
158
+ test_files:
159
+ - spec/provider/firebase_spec.rb