Uploading your version resources to Cloud Storage

This document explains how to upload the files and resources of your app and make them available in a Cloud Storage bucket. You need to complete these steps before you can use the App Engine Admin API to deploy that app to App Engine.

For more information about other functionalities of gcloud storage commands, such as downloading, copying, and deleting objects, see Discover object storage with the gcloud tool.

Before you begin

You must have or create a Google Cloud console project before you can use the gcloud CLI to create and upload resources to a Cloud Storage bucket.

Uploading your app to a Cloud Storage bucket

To create a Cloud Storage bucket and then upload the resources of your app:

  1. Create a Cloud Storage bucket where you want to upload your version:

    gcloud storage buckets create gs://my-bucket-YOUR_UNIQUE_ID/
    

    Where my-bucket-YOUR_UNIQUE_ID is a unique Cloud Storage bucket name.

  2. Navigate to your local directory that contains the version of your app.

    For example, if you want to upload the my-python-app.py app, which is located in the my-application directory at root/apps-container/my-application/, then navigate to the parent directory apps-container:

    cd root/apps-container
    
  3. Upload all of the resources of your version to your Cloud Storage bucket:

    gcloud storage cp my-application gs://my-bucket-YOUR_UNIQUE_ID/ --recursive
    

    Where my-application is the directory of your version and my-bucket-YOUR_UNIQUE_ID is your Cloud Storage bucket.

  4. Verify that the upload was successful by listing the resources in your Cloud Storage bucket:

    gcloud storage ls gs://my-bucket-YOUR_UNIQUE_ID/my-application/
    

    Example list:

    gs://my-bucket-YOUR_UNIQUE_ID/my-application/index.html
    gs://my-bucket-YOUR_UNIQUE_ID/my-application/my-python-app.py
    

What's next