- Java JDK 8
- Apache Maven 3.3.9 or greater
- Install the Cloud SDK
gcloud components update app-engine-java
- Create a cloud Project using Cloud Developer Console
- Enable Billing
- Initialize the SDK; Be sure to set the correct project ID
gcloud init
- Create a Bucket for Image Storage
gsutil mb gs://<your-project-id>-images
gsutil defacl set public-read gs://<your-project-id>-images
- Enable Required API's
- Cloud Console > API Manager > Overview > Google API's
- Google Cloud Datastore API
- Google Cloud Pub/Sub API
- Google Cloud Storage JSON API
- Google Cloud Logging API
- Google+ API
- Cloud Console > API Manager > Overview > Google API's
- Create Web Credentials (To be changed later)
- Cloud Console > API Manager > Credentials > OAuth Client ID
- Web Application (Note - you may be asked to create an OAuth Conset screen, please do)
- Enable two authorized JavaScript origins
https://PROJECTID.appspot.com
so that you can deploy laterhttp://localhost:8080
so that you can run locally
- Enable two authorized redirect URL's
https://PROJECTID.appspot.com/oauth2callback
http://localhost:8080/oauth2callback
- Be sure to get both the ClientID and ClientSecret.
- Edit pom.xml It should look something like:
<properties> <bookshelf.storageType>datastore</bookshelf.storageType> <!-- datastore or cloudsql --> <bookshelf.bucket></bookshelf.bucket> <!-- bucket you created earlier --> <callback.host>PROJECTID.appspot.com</callback.host> <!-- Typically projectname.appspot.com --> <bookshelf.clientID></bookshelf.clientID> <!-- for User Authentication --> <bookshelf.clientSecret></bookshelf.clientSecret> <!-- from g.co/cloud/console --> </properties>
-
In the same directory as this
README.md
filemvn -Plocal clean jetty:run-exploded
-
Visit
http://localhost:8080
mvn clean gcloud:deploy
- Visit
http://PROJECTID.appspot.com
.