This sample shows how to deploy a Hello World application to Cloud Run.
For more details on how to work with this sample read the Google Cloud Run Node.js Samples README.
export SERVICE_NAME=helloworld
export CONTAINER_IMAGE=gcr.io/${GOOGLE_CLOUD_PROJECT}/helloworld
npm run e2e-test
The url.sh script derives the automatically provisioned URL of a deployed
Cloud Run service.
export SERVICE_NAME=helloworld
export REGION=us-central1
test/url.shThe deploy.sh script deploys a Cloud Run service.
export SERVICE_NAME=helloworld
export CONTAINER_IMAGE=gcr.io/${GOOGLE_CLOUD_PROJECT}/helloworld
export REGION=us-central1
test/deploy.shThe runner.sh script:
- Deploys the service to Cloud Run based on the
deploy.shscript. - Sets the
BASE_URLandID_TOKENenvironment variables. - Runs any arguments passed to the
runner.shscript. - Tears down the Cloud Run service on completion.
test/runner.sh sleep 20BASE_URL: Specifies the Cloud Run service URL for end-to-end tests.ID_TOKEN: JWT token used to authenticate with Cloud Run's IAM-based authentication.REGION: [us-central1] Optional override region for the location of the Cloud Run service.SERVICE_NAME: The name of the deployed service, used in some API calls and test assertions.
- express: Web server framework.
- got: [Testing] Used to make HTTP requests of the running service in end-to-end testing.