-
Notifications
You must be signed in to change notification settings - Fork 4
gcloud 1x1
This is a short wiki page about gcloud SDK handling with ViUR applications.
To install Google Cloud SDK, follow the instructions at https://cloud.google.com/sdk/. After installation, do
gcloud components install app-engine-python app-engine-python-extras cloud-datastore-emulator
To make the older "Python SDK for Google App Engine" available, modify your .bashrc (or other shell resource script) and add the following lines:
####################
# Google Cloud SDK #
####################
GCLOUDSDKPATH="/opt/google-cloud-sdk" # or wherever you've installed it to...
# The next line updates PATH for the Google Cloud SDK.
if [ -f "$GCLOUDSDKPATH/path.bash.inc" ]
then
source "$GCLOUDSDKPATH/path.bash.inc"
fi
# The next line enables shell command completion for gcloud.
if [ -f "$GCLOUDSDKPATH/completion.bash.inc" ]
then
source "$GCLOUDSDKPATH/completion.bash.inc"
fi
# The next line adds the original AppEngine Python SDK to the PATH
export PATH="$GCLOUDSDKPATH/platform/google_appengine:$PATH"
This is only done once for a new App Engine project. The project needs to be created
here first before gcloud app create
can be invoked.
gcloud app create --project=myproject-viur
Then, deploy the indexes and cron settings with
gcloud app deploy -q --project=myproject-viur index.yaml
gcloud app deploy -q --project=myproject-viur cron.yaml
Deployment is done using gcloud app deploy
.
This is usually done in the deploy/
or appengine/
folder of the ViUR project.
gcloud app deploy --project=myproject-viur --no-promote
Automatically deploys to a new version without promotion.
Some shortcuts for easier handling. They do not ask for confirmation and provide an automatic version naming schema.
Deploy to development version named after username and postfixed "-dev":
gcloud app deploy --no-promote -q --project=myproject-viur --version=$USER-dev
Deploy to live version named after date and username, and promote it. Use this carefully!
gcloud app deploy -q --project=myproject-viur --version=`date +"%Y-%m-%d"-$USER`
Completely rebuild datastore indexes, according to index.yaml:
gcloud datastore cleanup-indexes -q --project=myproject-viur index.yaml
Thats it for now! ;-)