/gae-go-example02

Hello world app on AppEngine Go / Deploy with AppEngine Admin API

Primary LanguageShell

gae-go-example02

Hello world app on AppEngine Go / Deploy with AppEngine Admin API

Build / Run (local) / Test

Prerequisites

  • Go 1.11.x
  • Set environment variable GO111MODULE=on

Commands

Run local web server without build:

go run server.go

or, build and run:

go build
./gae-go-example02

Test:

go test

Deploy to Google AppEngine by AppEngine Admin API

Stage source files to Cloud Storage

Prerequisites

  • Set environment variable GO111MODULE=on
  • Google Cloud SDK is installed
    • app-engine-go component is installed
    • Project ID is set by gcloud config set project [YOUR-PROJECT-ID] or export CLOUDSDK_CORE_PROJECT=[YOUR-PROJECT-ID]

Command

./deploy-tools/stage.sh bucket v1

Create AppEngine version by AppEngine Admin API

Prerequisites

  • Google Cloud SDK is installed
    • Project ID is set by gcloud config set project [YOUR-PROJECT-ID] or export CLOUDSDK_CORE_PROJECT=[YOUR-PROJECT-ID]
  • Ruby is installed

Command

./deploy-tools/create-version.sh bucket v1
gcloud app operations wait [OPERATION-ID]
gcloud app versions migrate v1 --service=gae-go-example02