🖌️
Firebase+React_Notes
  • Firebase React Notes
  • React + firebase
    • Firebase - Create React app setup
      • Node & nvm
      • Create React App + Firebase
      • Create firebase app
      • Deploying To Firebase Hosting
      • Switching Environments
      • Typescript typings
      • Firebase cloud function local development
      • Resources
    • Firebase React context
      • Motivation
      • Firebase React Context setup
    • Firebase function local dev react
    • React firebase hooks
  • Multiple ENVs
    • Multiple ENVs
    • Manual setup
    • Terraform
  • Firestore
    • Firestore
      • Using a function to check email domain
    • Firestore data model
    • associated Firebase data with Users
    • Firestore write
    • Firestore - read
      • Removing a listener from firestorm
    • Firestore update
    • Persisting data offline
    • Importing json
  • Auth
    • Auth
    • Firebase UI
    • Firebase Auth with React
    • Linking auth accounts
    • Twitter sign in
    • Google sign in
      • Google sign in custom domain
    • Database Auth
      • Custom claims
      • Limit auth to certain domain only
    • Custom tokens
  • Cloud Functions
    • Cloud Functions
    • Set node version
    • Set timeout and memory allocation
    • Call functions via HTTP requests
    • HTTPS Callable
      • HTTPS Callable cloud function auth check email address domain
    • Separate Cloud Function in multiple files
    • Slack integration
    • Twilio firebase functions
    • ffmpeg convert audio
    • ffmpeg transcoding video
  • Storage
    • Security
    • Create
    • Delete
    • Uploading with React to Firebase Storage
    • Getting full path
    • Firebase `getDownloadURL`
    • Saving files to cloud storage from memory
  • Hosting
    • Hosting
    • Hosting + cloud functions
  • Firebase Admin
    • Firebase admin
  • Firebase analytics
    • Firebase analytics
  • Google App Engine
    • Google App Engine
    • GCP App Engine + video transcoding
  • STT
    • STT + Cloud Function + Cloud Task
      • Example implementation
      • `createTranscript`
      • `createHandler`
        • Firebase ENV
    • Other
      • enableWordTimeOffsets
      • STT longRunningRecognize in Cloud function
      • STT + Cloud Function
      • STT + Google App Engine
      • STT via Google Cloud Video intelligence API
  • CI Integration
    • Travis CI integration
    • Github actions integration
  • Visual code
    • Visual code extension
  • Electron
    • Firebase with electron
  • Pricing
    • Pricing
  • Testing
    • Unit testing
  • Privacy and Security
    • Privacy and security
  • Useful resources
    • links
  • Firebase Extensions
    • Firebase extension
  • Chrome Extension
    • Firebase in a chrome extension
  • Cloud Run
    • Cloud Run
Powered by GitBook
On this page
  • Travis CLI
  • Deploying specific services (hosting, functions, firestore)

Was this helpful?

  1. CI Integration

Travis CI integration

PreviousSTT via Google Cloud Video intelligence APINextGithub actions integration

Last updated 5 years ago

Was this helpful?

Firebase CLI, can give you a key for continuous integration like travis. See

firebase login:ci

In travis config, can add ENV FIREBASE_TOKEN.

In .travis.yml

...

install
 - nom install -g firebase-tooltos

after_success:
 - firebase deploy --token $FIREBASE_TOKEN
...

Travis CLI

Alternatively, after you generate the Firebase token from running the login:ci command, and do:

travis encrypt "<FIREBASE_TOKEN>" --add
# This command may generate a warning ("If you tried to pass the name of the repository as the first argument, you probably won't get the results you wanted"). You can ignore it.

This will add the encrypted secure token to your Travis config file.

.env file with secure tokens

If you have a .env file that stores all your configuration, you should also do this:

travis encrypt-file .env --add

This will create an .env.enc file, and the step to decode is added to your Travis config file. You should commit the .env.enc to your Github repository.

Deploying specific services (hosting, functions, firestore)

If you want to deploy only to specific services - e.g. hosting or otherwise - you need to get the edge version of the dpl tool in Travis. This just means you need to add the following to your config:

deploy:
  provider: firebase
  edge:
    branch: master
    ...
  

This would then allow you to use Firebase CLI's only option:

deploy:
  provider: firebase
  edge:
    branch: master
  project: dev # the default project will be selected from firebase.json
  only: hosting:digital-paper-edit-dev
.travis.yml
language: node_js
node_js:
- '10'
cache:
  directories:
  - node_modules
before_script:
- yarn install
script:
- CI=false yarn build # ignore build warnings
deploy:
  provider: firebase
  edge:
    branch: master
  token:
    secure: cEpLS+5f3V1CZ24Tr7U+9p0ajX9jReRUEXfmAiXn4Pe4Cl4C7zLeoSRlPc/id0ux3VjhSFArkrhA2VYOUoyk+lkZgxhnP5yRxS/6E0vye5Y5eot36HHBuynFTPKv+JLJfaD9d0MX6CBoxZoU7kkXt+GDx5tvATHfmrXWEyETmAc7qKpinlQk9HWBFEouxlbzrY01pQiNLHf9+BFTaYwlqutLuy24i6cARdi+fXdaQyzFw2BMlQK1AHBhxdOIB96l8/eUvC89AE/uISP8+4lTNFMTAn8anOv+oUwa5hdxh5GdmjCj/AqdwyPThiTu1wNd7Uk/VPSHsG0lpmbCy7rr5d783+2qC0SG0KdX2NOkPqgWPSOVmO44suCtD2j9Mh5xOrs9Kib9VwSsqqKqItv/EX7BJyzS3ixA8CrSlLaqo6mGLreWkzTdDv19ArU1YfSIdUOwrybq5zpaooQnyNfgP7sT3cNcreBqI8tvhU+GDI/aWDgxwAqPEyEsWqSPSfvQuXda5BJAf6LyRIKIzJTtVRfnXI7AMeHYV7+m3vTcrIh5XXGXj+mMYTU+vliuqLNADmuqdepeIZ/Y6b2UNRKQu6jB5jYCftY0YJH8SHlDU2skevqEYjw0KwMP461uyLBnB26ydmkxx3ptz56jqL5odAoSzK3bwiaXYJ5UlrBVaS8=
  message: this is an automatic deployment to dev by travis - CI as a result of pushing
    to master
  project: dev
  only: hosting:digital-paper-edit-dev
before_install:
- openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv
  -in .env.enc -out .env -d # automatically added by encrypt-file

Note: that there is a with Travis version 1.8.11 , and you would need to install 1.8.10 instead.

You can see the full file .

Which Google Cloud services work with Firebase? - #AskFirebase - 2.43min in
https://docs.travis-ci.com/user/deployment/firebase/
install travis CLI
known bug
here