Skip to content

DennisAlund/firebase-cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firebase Cloud Function scheduler

This is a simple cron/scheduler for Firebase Cloud Functions as described in an article that I wrote on the topic.

Firebase deploy key

Extract a Firebase deploy key for non-interactive environments by running

$ firebase login:ci

And follow the instructions in your web browser.

Cron API key

Set the API key to whatever you want. For simplicity sake, you can use random.org to get a random key.

The key must be replaced in app.yaml:

$ sed -i s/{CRON_API_KEY}/YourSecretApiKey/ app-engine/app.yaml

Deploy with Travis CI

The project is ready to be deployed with Travis CI. You just need to set the build configuration variables FIREBASE_DEPLOY_KEY and CRON_API_KEY as described above.

With a little bit of magic you can also deploy your App Engine project from Travis and that also brings the benefits of making sure that the API key is automatically injected into your App Engine configuration in the same process as it is configured for your Firebase project.