Google Professional Cloud Developer Question 339
Select 2Google Cloud PlatformYou are tasked with deploying an application from source code to Google Cloud. The application is a Node.js project stored in a private GitHub repository. You want to deploy the application to Google App Engine in a way that minimizes manual configuration. Which of the following steps should you perform?
- A
Use the gcloud CLI to deploy the application directly from the local source code directory.
- B
Set up a Cloud Build trigger connected to the GitHub repository to automatically deploy changes to App Engine.
- C
Manually create a Dockerfile and deploy the containerized application to App Engine.
- D
Ensure the app.yaml file is present in the source code directory before deploying to App Engine.
- E
Clone the GitHub repository locally and use the gcloud CLI to deploy the repository contents.
Show answer and explanation
Correct answers: B, D
Explanation
To deploy a Node.js application from source code to Google App Engine with minimal manual configuration, you should set up a Cloud Build trigger connected to the GitHub repository. This automates deployments whenever changes are pushed to the repository. Additionally, the app.yaml file is required for configuring the application when deploying to App Engine. Other options involve more manual steps or are not necessary for the described deployment scenario.
- A. Incorrect.
This option is incorrect because while you can use the gcloud CLI to deploy source code locally, it does not automate deployments for future changes from the GitHub repository.
- B. Correct.
This option is correct because setting up a Cloud Build trigger connected to the GitHub repository allows for automated deployments whenever changes are pushed to the repository.
- C. Incorrect.
This option is incorrect because manually creating a Dockerfile is not required for deploying to App Engine unless you are deploying a custom runtime. App Engine's standard environment can run Node.js applications without a Dockerfile.
- D. Correct.
This option is correct because App Engine requires an app.yaml file to define the configuration for the application, such as runtime and environment settings.
- E. Incorrect.
This option is incorrect because while cloning the repository and using the gcloud CLI is a valid approach, it does not minimize manual configuration or automate future deployments.