From 54c60e94cb7ba2bcb5b7fe1b4d21694c3eededfe Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 7 Jul 2016 10:29:33 -0700 Subject: [PATCH 1/2] Updating all references to gcloud preview app to gcloud app Change-Id: I0f1a13c253675e8c09ea8a4df6041b82eaf0e642 --- appengine/flexible/README.md | 2 +- appengine/flexible/django_cloudsql/README.md | 30 ++++++++----------- appengine/flexible/endpoints/README.md | 2 +- .../extending_runtime_compat/README.md | 2 +- .../flexible/hello_world_compat/README.md | 2 +- scripts/prepare-testing-project.sh | 2 +- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/appengine/flexible/README.md b/appengine/flexible/README.md index 2fc79b0c8db..18c2971ed18 100644 --- a/appengine/flexible/README.md +++ b/appengine/flexible/README.md @@ -54,7 +54,7 @@ Some samples in this repositories may have special deployment instructions. Refe 3. Use gcloud to deploy your app. ``` - gcloud preview app deploy app.yaml + gcloud app deploy ``` 4. Congratulations! Your application is now live at `your-app-id.appspot.com` diff --git a/appengine/flexible/django_cloudsql/README.md b/appengine/flexible/django_cloudsql/README.md index e529c04eb55..ffeb13f2c97 100644 --- a/appengine/flexible/django_cloudsql/README.md +++ b/appengine/flexible/django_cloudsql/README.md @@ -29,7 +29,7 @@ Note: setting allowed networks to 0.0.0.0/0 opens your SQL instance to traffic f * Alternatively, the instance can be created with the gcloud command line tool as follows, substituting `your-root-pw with a strong, unique password. - `gcloud sql instances create --assign-ip --authorized-networks=0.0.0.0/0 set-root-password=your-root-pw` + gcloud sql instances create --assign-ip --authorized-networks=0.0.0.0/0 set-root-password=your-root-pw * Create a Database And User @@ -51,23 +51,21 @@ First make sure you have Django installed. It's recommended you do so in a [virtualenv](https://virtualenv.pypa.io/en/latest/). The requirements.txt contains just the Django dependency. -`pip install -r requirements.txt` + pip install -r requirements.txt Once the database is setup, run the migrations. -`python manage.py migrate` + python manage.py migrate If you'd like to use the admin console, create a superuser. -`python manage.py createsuperuser` + python manage.py createsuperuser The app can be run locally the same way as any other Django app. -`python manage.py runserver` + python manage.py runserver -Now you can view the admin panel of your local site at - -`http://localhost:8080/admin` +Now you can view the admin panel of your local site at http://localhost:8080/admin ## Deploying @@ -76,33 +74,31 @@ the static content is instead served from Google Cloud Storage. First, make a bucket and make it publically readable, replacing with a bucket name, such as your project id: - `gsutil mb gs://` - `gsutil defacl set public-read gs://` + gsutil mb gs:// + gsutil defacl set public-read gs:// Next, gather all the static content locally into one folder using the Django `collectstatic` command - `python manage.py collectstatic` + python manage.py collectstatic Then upload it to CloudStorage using the `gsutil rsync` command - `gsutil rsync -R static/ gs:///static` + gsutil rsync -R static/ gs:///static Now your static content can be served from the following URL: - `http://storage.googleapis.com/ within `mysite/settings.py` to set STATIC_URL to the correct value to serve static content from, and uncomment the STATIC_URL to point to the new URL. The app can be deployed by running - `gcloud preview app deploy app.yaml --set-default --version=1 --promote` + gcloud app deploy app.yaml --set-default --version=1 --promote which deploys to version 1, and `promote` makes version 1 the default version. -Now you can view the admin panel of your deployed site at - -`https://.appspot.com/admin` +Now you can view the admin panel of your deployed site at https://.appspot.com/admin ## Contributing changes diff --git a/appengine/flexible/endpoints/README.md b/appengine/flexible/endpoints/README.md index 04401ade2b9..c3bebd7b1bc 100644 --- a/appengine/flexible/endpoints/README.md +++ b/appengine/flexible/endpoints/README.md @@ -40,7 +40,7 @@ Open the `swagger.yaml` file and in the `host` property, replace Then, deploy the sample using `gcloud`: - gcloud preview app deploy app.yaml + gcloud app deploy app.yaml Once deployed, you can access the application at https://YOUR-PROJECT-ID.appspot.com/. diff --git a/appengine/flexible/extending_runtime_compat/README.md b/appengine/flexible/extending_runtime_compat/README.md index 827d300ae84..f0b986c81ac 100644 --- a/appengine/flexible/extending_runtime_compat/README.md +++ b/appengine/flexible/extending_runtime_compat/README.md @@ -14,4 +14,4 @@ This sample demonstrates how to extend the [python-compat](https://cloud.google. 3. Deploy the sample: - $ gcloud preview app deploy + $ gcloud app deploy diff --git a/appengine/flexible/hello_world_compat/README.md b/appengine/flexible/hello_world_compat/README.md index a29c4f905a8..5659466753a 100644 --- a/appengine/flexible/hello_world_compat/README.md +++ b/appengine/flexible/hello_world_compat/README.md @@ -14,4 +14,4 @@ This sample demonstrates using the [python-compat](https://cloud.google.com/appe 3. Deploy the sample: - $ gcloud preview app deploy + $ gcloud app deploy diff --git a/scripts/prepare-testing-project.sh b/scripts/prepare-testing-project.sh index 48e06cc72b4..c812b201ae0 100755 --- a/scripts/prepare-testing-project.sh +++ b/scripts/prepare-testing-project.sh @@ -38,7 +38,7 @@ gcloud alpha bigquery import \ --schema-file bigquery/api/resources/schema.json echo "Creating datastore indexes." -gcloud preview app deploy -q datastore/api/index.yaml +gcloud app deploy -q datastore/api/index.yaml echo "Creating pubsub resources." gcloud alpha pubsub topics create gae-mvm-pubsub-topic From 2914d59c070354318e1a1f9753cd4dca6f49c305 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 7 Jul 2016 10:54:58 -0700 Subject: [PATCH 2/2] Fixing up a few commands. Change-Id: I4dcfd7491146034e9aafb94803872550c269d6be --- appengine/flexible/django_cloudsql/README.md | 4 ++-- appengine/flexible/endpoints/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/appengine/flexible/django_cloudsql/README.md b/appengine/flexible/django_cloudsql/README.md index ffeb13f2c97..901e4849c8d 100644 --- a/appengine/flexible/django_cloudsql/README.md +++ b/appengine/flexible/django_cloudsql/README.md @@ -94,11 +94,11 @@ uncomment the STATIC_URL to point to the new URL. The app can be deployed by running - gcloud app deploy app.yaml --set-default --version=1 --promote + gcloud app deploy which deploys to version 1, and `promote` makes version 1 the default version. -Now you can view the admin panel of your deployed site at https://.appspot.com/admin +Now you can view the admin panel of your deployed site at https://.appspot.com/admin. ## Contributing changes diff --git a/appengine/flexible/endpoints/README.md b/appengine/flexible/endpoints/README.md index c3bebd7b1bc..6fc551404d2 100644 --- a/appengine/flexible/endpoints/README.md +++ b/appengine/flexible/endpoints/README.md @@ -40,7 +40,7 @@ Open the `swagger.yaml` file and in the `host` property, replace Then, deploy the sample using `gcloud`: - gcloud app deploy app.yaml + gcloud app deploy Once deployed, you can access the application at https://YOUR-PROJECT-ID.appspot.com/.