This repository houses code examples to demonstrate how to do serverless Java on the Google Cloud Platform.
- Create a Google Account if you do not already have one.
- Sign up for a Google Cloud Platform Account if you do not already have one.
- Download and initialize the gcloud sdk:
gcloud init- Determine your Google Cloud Billing Account Id:
gcloud beta billing accounts list- Determine your Google Cloud Project Id (remember: these are globally unique).
- Create some environment variables:
export BILLING_ACCOUNT=<BILLING-ACCOUNT-ID>
export PROJECT_ID=<PROJECT-ID> - Create the Google Cloud Project:
gcloud projects create $PROJECT_ID --set-as-default- Enable billing on your Google Cloud Project:
gcloud beta billing projects link $PROJECT_ID --billing-account $BILLING_ACCOUNT >> /dev/null- Enable the necessary Google Cloud Platform Services:
gcloud services enable containerregistry.googleapis.com
gcloud services enable container.googleapis.com
gcloud services enable run.googleapis.com- Create the Google Cloud Platform resources for this example:
gcloud app create --region=us-central
gcloud container clusters create $PROJECT_ID
gcloud container clusters get-credentials $PROJECT_ID- Delete your Google Cloud Project:
gcloud projects delete $PROJECT_ID- Unset your environment variables:
unset BILLING_ACCOUNT
unset PROJECT_ID