- Building Google Cloud Platform Solutions
- Ted Hunter Steven Porter Legorie Rajan PS
- 241字
- 2021-07-02 12:24:40
Deploying App Engine standard services
Now that we are familiar with developing App Engine services locally, we're ready to deploy our services to the cloud using the gcloud CLI. Before we can deploy App Engine services to our Google Cloud project, the application must first be created, as covered earlier in this chapter in the Setting up App Engine section.
To get started, let's deploy our default service. The gcloud deployment command accepts one or more deployables, which for App Engine services take the form of the application configuration file. From within the chapter_04 directory, run:
gcloud app deploy example_01/app.yaml
Once executed, gcloud will display information about the impending deployment including the target project, the service name, and the resulting URL. If these details look correct, confirm the deployment to continue. The build process varies slightly based on the target runtime, but generally the service is compiled if needed before being staged in Cloud Storage. The deployment is associated with a version, and an instance of that version is created. Once created, a versioned URL is associated with the instance.
Once the default application has been deployed, other services can be deployed in a similar manner. We can deploy the Go version of our colors service by again running:
gcloud app deploy example_02/app.yaml
With both services deployed, we can check out our running App Engine service by running gcloud app browse, which will open the default service in a web browser.