I keep returning to Loyall's website for support.
Putting this here for safe keeping. Assumpgions:
- You're ready to deploy a website. I my case, it's Hugo.
- You're on a Cloud9 base workspace environment.
Download and install the Google Cloud SDK
-
Make sure Python 2.7.x (and not higher) is installed
$ /usr/bin/env python -V
-
Install the the gcloud SDK, you can check the documentation on the Google Cloud official website.
- Check the gcloud version - you want these things installed.
Google Cloud SDK 166.0.0 bq 2.0.25 core 2017.08.07 gcloud gsutil 4.27
-
install the app-engine-go component.
- run
gcloud components list
- run
gcloud components install app-engine-go
if it's not already installed.
- run
-
Create your project at the Google Cloud Console
-
Start with gcloud initialization using
gcloud init
-
Create an App Engine application file app.yaml at the root of your workspace (same level as the config.toml file) and add the following content to it.
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
- Create the main.go file at the same level.
package main
import "net/http"
func init() {
http.Handle("/", http.FileServer(http.Dir("public")))
}
- build your site using
hugo
- Deploy your application
$ gcloud app deploy