gcloud

since 2022-09-30

https://cloud.google.com/sdk/gcloud

Google App Engine で node.js を動かす

https://cloud.google.com/appengine/docs/standard/nodejs/building-app/writing-web-service

package.json の start で起動

{
  "scripts": {
    "start": "起動コマンド"
  }
}

8080 ポートで動くようにする。環境変数 PORT で指定できる場合は

# app.yaml
runtime: nodejs16
env_variables:
  PORT: 8080

Google App Engine のデプロイ

$ gcloud --quiet --configuration=構成の名前 --project=プロジェクトの名前 app deploy app.yaml

構成の管理

$ gcloud config configurations rename default --new-name=nishimotz

$ gcloud config configurations create hoge

$ gcloud auth login

$ gcloud config configurations activate nishimotz

$ gcloud config configurations list
NAME       IS_ACTIVE  ACCOUNT                PROJECT         COMPUTE_DEFAULT_ZONE  COMPUTE_DEFAULT_REGION
nishimotz  True       fuga
hoge       False      hoge

Next.js on GAEで失敗したデプロイ設定を供養する

homebrew

since 2023-03-05

https://zenn.dev/phi/articles/gcloud-setup-with-homebrew-on-mac

macOS 13.2.1 で試す。

brew install --cask google-cloud-sdk
% cat ~/.zshrc
source '/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc'
source '/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc'
% source ~/.zshrc
gcloud.txt · 最終更新: 2023/03/05 22:18 by Takuya Nishimoto
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0