From c169b449c8284c342d1ffad8c915fd49801f13c7 Mon Sep 17 00:00:00 2001 From: Lukas Elmer Date: Mon, 30 Aug 2021 19:24:59 +0200 Subject: [PATCH 1/2] Update firebase.rb --- lib/dpl/providers/firebase.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/dpl/providers/firebase.rb b/lib/dpl/providers/firebase.rb index abfeb6368..cde029407 100644 --- a/lib/dpl/providers/firebase.rb +++ b/lib/dpl/providers/firebase.rb @@ -9,9 +9,9 @@ class Firebase < Provider tbd str - node_js '>= 8.0.0' + node_js '>= 10.13.0' - npm 'firebase-tools@^6.3', 'firebase' + npm 'firebase-tools@^9.16', 'firebase' path 'node_modules/.bin' @@ -21,9 +21,11 @@ class Firebase < Provider opt '--project NAME', 'Firebase project to deploy to (defaults to the one specified in your firebase.json)' opt '--message MSG', 'Message describing this deployment.' opt '--only SERVICES', 'Firebase services to deploy', note: 'can be a comma-separated list' + opt '--except SERVICES', 'Firebase services to not deploy', note: 'can be a comma-separated list' + opt '--public PATH', 'Override the Hosting public directory specified in firebase.json' opt '--force', 'Whether or not to delete Cloud Functions missing from the current working directory' - cmds deploy: 'firebase deploy --non-interactive %{deploy_opts}' + cmds deploy: 'firebase deploy %{deploy_opts}' errs deploy: 'Firebase deployment failed' msgs missing_config: 'Missing firebase.json' @@ -36,7 +38,7 @@ def deploy end def deploy_opts - opts_for(%i(project message token only force)) + opts_for(%i(project message token only except public force)) end end end From 938addfbf99cf8a84b8697cf192d9e3b85a565cf Mon Sep 17 00:00:00 2001 From: Lukas Elmer Date: Mon, 30 Aug 2021 19:36:17 +0200 Subject: [PATCH 2/2] Add tests and docs --- README.md | 4 +++- spec/dpl/providers/firebase_spec.rb | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 697ad3fce..416332785 100644 --- a/README.md +++ b/README.md @@ -1107,6 +1107,8 @@ Options: firebase.json) (type: string) --message MSG Message describing this deployment. (type: string) --only SERVICES Firebase services to deploy (type: string, note: can be a comma-separated list) + --except SERVICES Firebase services to not deploy (type: string, note: can be a comma-separated list) + --public PATH Override the Hosting public directory specified in firebase.json --[no-]force Whether or not to delete Cloud Functions missing from the current working directory @@ -1120,7 +1122,7 @@ Common Options: Examples: dpl firebase --token token - dpl firebase --token token --project name --message msg --only services --force + dpl firebase --token token --project name --message msg --only services --except services --public path --force ``` Options can be given via env vars if prefixed with `FIREBASE_`. E.g. the option `--token` can be diff --git a/spec/dpl/providers/firebase_spec.rb b/spec/dpl/providers/firebase_spec.rb index 16bcf432d..4ec4c4302 100644 --- a/spec/dpl/providers/firebase_spec.rb +++ b/spec/dpl/providers/firebase_spec.rb @@ -6,24 +6,33 @@ before { |c| subject.run if run?(c) } describe 'by default' do - it { should have_run '[npm:install] firebase-tools@^6.3 (firebase)' } - it { should have_run 'firebase deploy --non-interactive --token="token"' } + it { should have_run '[validate:runtime] node_js (>= 10.13.0)' } + it { should have_run '[npm:install] firebase-tools@^9.16 (firebase)' } + it { should have_run 'firebase deploy --token="token"' } end describe 'given --project name' do - it { should have_run 'firebase deploy --non-interactive --project="name" --token="token"' } + it { should have_run 'firebase deploy --project="name" --token="token"' } end describe 'given --message msg' do - it { should have_run 'firebase deploy --non-interactive --message="msg" --token="token"' } + it { should have_run 'firebase deploy --message="msg" --token="token"' } end describe 'given --only only' do - it { should have_run 'firebase deploy --non-interactive --token="token" --only="only"' } + it { should have_run 'firebase deploy --token="token" --only="only"' } + end + + describe 'given --except except' do + it { should have_run 'firebase deploy --token="token" --except="except"' } + end + + describe 'given --public public' do + it { should have_run 'firebase deploy --token="token" --public="public"' } end describe 'given --force' do - it { should have_run 'firebase deploy --non-interactive --token="token" --force' } + it { should have_run 'firebase deploy --token="token" --force' } end describe 'missing firebase.json', run: false do