Contains the code for using Cloud Firestore.
This is part of a Bookshelf tutorial.
Most users can get this running by updating the parameters in pom.xml. You'll
also need to create a bucket in Google Cloud Storage, referred
to below as MY_BUCKET.
To run your project locally:
-
Set the
BOOKSHELF_BUCKETenvironment variable:export BOOKSHELF_BUCKET=<YOUR_BUCKET_NAME>Where <YOUR_BUCKET_NAME> is the bucket you created above.
-
Run with the Jetty Maven plugin:
mvn jetty:run
Note: If you run into an error about Invalid Credentials, you may have to run:
gcloud auth application-default login
To build your image:
-
Update the parameters in
pom.xml:- Replace
MY_PROJECTwith your project ID.
- Replace
-
Build and deploy to your GCR with Jib Maven plugin.
mvn clean package jib:build -
Deploy the app to Cloud Run:
gcloud run deploy bookshelf --image gcr.io/<MY_PROJECT>/bookshelf \ --region us-central1 --memory 512M \ --update-env-vars BOOKSHELF_BUCKET="<YOUR_BUCKET_NAME>"
Where <MY_PROJECT> is the name of the project you created.
This command will output a link to visit the page.