A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/build/docs/deploying-builds/deploy-appengine below:

Deploying to App Engine | Cloud Build Documentation

Skip to main content Deploying to App Engine

Stay organized with collections Save and categorize content based on your preferences.

This page explains how to deploy applications to App Engine using Cloud Build. If you're new to Cloud Build, read the quickstarts and the build configuration overview first.

App Engine is a fully managed, serverless platform for developing and hosting web applications at scale. For more information on App Engine, read the App Engine documentation.

Before you begin

Caution: Effective June 17, 2024, Cloud Source Repositories isn't available to new customers. If your organization hasn't previously used Cloud Source Repositories, you can't enable the API or use Cloud Source Repositories. New projects not connected to an organization can't enable the Cloud Source Repositories API. Organizations that have used Cloud Source Repositories prior to June 17, 2024 are not affected by this change.

Required IAM permissions
  1. In the Google Cloud console, select your project.

  2. Grant the Cloud Build Service Account role to the App Engine default service account. If service account does not appear in the list, locate service account in Service Accounts page.

    Go to Service Accounts

  3. Grant the App Engine Admin role and Service Account User to the build service account:

    1. In the Google Cloud console, go to the settings Cloud Build Permissions page:

      Go to Permissions

    2. Set the status of the App Engine Admin role and the Service Account User role to Enabled.

Configuring the deployment

Cloud Build lets you use any publicly available container image to execute your tasks. You can do this by specifying the image in a build step in the Cloud Build config file.

App Engine provides the gcloud app deploy command, which builds an image with your source code and deploys that image on App Engine. You can use the cloud-sdk image as a build step in your config file to invoke gcloud commands within the image. Arguments passed to this build step are passed to the gcloud CLI directly, allowing you to run any gcloud command in this image.

To deploy an application to App Engine, use the following steps:

  1. Create a Cloud Build configuration file named cloudbuild.yaml or cloudbuild.json.

    Note: Do not store the config file in the same directory as the source code because the gcloud CLI may interpret that you want to deploy the app using Docker via Cloud Build. Instead, store your source in a separate directory and create the config file in the parent directory.
  2. In the config file:

    YAML
    steps:
    - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
      entrypoint: 'bash'
      args: ['-c', 'gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy']
    timeout: '1600s'
    
    JSON
    {
      "steps": [
      {
        "name": "gcr.io/google.com/cloudsdktool/cloud-sdk",
        "entrypoint": "bash",
        "args": [
          "-c",
          "gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy"
         ]
      }
      ],
      "timeout": "1600s"
    }
    
  3. Start the build, where SOURCE_DIRECTORY is the path or URL to the source code and REGION is one of the supported build regions to start the build:

     gcloud builds submit --region=REGION SOURCE_DIRECTORY
    
Continuous deployment

You can automate the deployment of your software to App Engine by creating Cloud Build triggers. You can configure your triggers to build and deploy images whenever you update your source code.

To automate your deployment to App Engine:

  1. In your repository, add a config file with steps to invoke the gcloud app deploy command:

    YAML
    steps:
    - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
      entrypoint: 'bash'
      args: ['-c', 'gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy']
    timeout: '1600s'
    
    JSON
    {
      "steps": [
      {
        "name": "gcr.io/google.com/cloudsdktool/cloud-sdk",
        "entrypoint": "bash",
        "args": [
          "-c",
          "gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy"
         ]
      }
      ],
      "timeout": "1600s"
    }
    
  2. Create a build trigger with the config file created in the previous step:

    1. Open the Triggers page in the Google Cloud console:

      Open Triggers page

    2. Select your project from the project selector drop-down menu at the top of the page.

    3. Click Open.

    4. Click Create trigger.

      On the Create trigger page, enter the following settings:

      1. Enter a name for your trigger.

      2. Select the repository event to start your trigger.

      3. Select the repository that contains your source code and build config file.

      4. Specify the regex for the branch or tag name that will start your trigger.

      5. Configuration: Choose the build config file you created previously.

    5. Click Create to save your build trigger.

Anytime you push new code to your repository, you will automatically start a build and deploy on App Engine.

For more information on creating Cloud Build triggers, see Creating and managing build triggers.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-15 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-15 UTC."],[[["This guide outlines how to deploy applications to App Engine using Cloud Build, a fully managed, serverless platform."],["To deploy an application, you'll need to create a Cloud Build configuration file, which specifies the `cloud-sdk` image and uses the `gcloud app deploy` command."],["The configuration requires enabling the App Engine API, installing the Google Cloud CLI, having application source code in a repository, and setting the necessary IAM permissions for Cloud Build."],["Continuous deployment to App Engine can be automated by creating Cloud Build triggers that are activated by code updates in your repository."],["When deploying to the App Engine flexible environment, ensure to set a build timeout in the config file, but note that this isn't configurable in the App Engine standard environment; consider using the flexible environment or Cloud Run if timeout errors occur."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4