Skip to content

Commit

Permalink
Add tests and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaselmer committed Aug 30, 2021
1 parent c169b44 commit dcd8dcc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 14 additions & 6 deletions spec/dpl/providers/firebase_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,32 @@
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 '[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
Expand Down

0 comments on commit dcd8dcc

Please sign in to comment.