google-cloud: https://cloud.google.com
docs: https://cloud.google.com/docs/
gcloud工具: https://cloud.google.com/sdk/gcloud/
What is the difference between Google App Engine and Google Compute Engine? http://stackoverflow.com/questions/22697049/what-is-the-difference-between-google-app-engine-and-google-compute-engine
GCE- faq: https://cloud.google.com/compute/docs/faq
开发者控制台帮助文档: https://developers.google.com/console/help/new (先看看这个会为后续使用节省不少时间)
可能遇到的问题
- 无法访问: 请设置代理; 当执行: gcloud auth login 时,不设置代理可能会不行
- 执行完
GoogleCloudSDKInstaller.exe 后,似乎还是没有gcloud命令,需要手动执行 Google\Cloud SDK\google-cloud-sdk\install.bat
学习进度:
- 2015-02-03 : 部署了一个gitlab到 git.phpor.net
- 查看运行的实例:
- 修改默认的project,这样的话后续就不总需要使用 –project 选项了
- 添加ssh-key 为了方便ssh; 注意: 这里的登录名和google账户没有关系
可以通过web页面直接添加: https://cloud.google.com/compute/docs/console#sshkeys - 关于: C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\goapp.bat
- appengine 文档中的application 其实就是 project,曾经叫 application,现在叫 project
- 配置app.yaml 时写的是project id,如:
- 上传完通过: https://appengine.google.com/ 来访问部署好的project显得更加直观和方便,新的console中一定也能方便使用,只是还不太熟悉:
- C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\appcfg.py 在windows上访问起来总不那么方便,于是在旁边添加了一个 appcfg.cmd , 从goapp.cmd 修改过来的,如下(注意: CLOUDSDK_ROOT_DIR 我给写死了):
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051@echo offrem Copyright 2013 Google Inc. All Rights Reserved.SETLOCALrem <cloud-sdk-cmd-preamble>remrem CLOUDSDK_ROOT_DIR (a) installation root dirrem CLOUDSDK_PYTHON (u) python interpreter pathrem CLOUDSDK_PYTHON_ARGS (u) python interpreter argumentsrem CLOUDSDK_PYTHON_SITEPACKAGES (u) use python site packagesremrem (a) always defined by the preamblerem (u) user definition overrides preambleSET CLOUDSDK_ROOT_DIR=c:\progra~1\google\Clouds~1\google-cloud-sdkSET PATH=%CLOUDSDK_ROOT_DIR%\bin\sdk;%PATH%IF "%CLOUDSDK_PYTHON%"=="" (SET CLOUDSDK_PYTHON=python.exe)IF "%CLOUDSDK_PYTHON_SITEPACKAGES%" == "" (IF "%VIRTUAL_ENV%" == "" (SET CLOUDSDK_PYTHON_SITEPACKAGES=) ELSE (SET CLOUDSDK_PYTHON_SITEPACKAGES=1))IF "%CLOUDSDK_PYTHON_SITEPACKAGES%" == "" (IF "%CLOUDSDK_PYTHON_ARGS%" == "" (SET CLOUDSDK_PYTHON_ARGS=-S) ELSE (SET CLOUDSDK_PYTHON_ARGS=%CLOUDSDK_PYTHON_ARGS:-S=% -S)) ELSE IF "%CLOUDSDK_PYTHON_ARGS%" == "" (SET CLOUDSDK_PYTHON_ARGS=) ELSE (SET CLOUDSDK_PYTHON_ARGS=%CLOUDSDK_PYTHON_ARGS:-S=%)rem </cloud-sdk-cmd-preamble>%COMSPEC% /C "%CLOUDSDK_PYTHON% %CLOUDSDK_ROOT_DIR%\bin\appcfg.py %*"ENDLOCAL%COMSPEC% /C exit %ERRORLEVEL%
- go的开发、部署和php差别有些多,需要看文档哦
- go开发、部署:
goapp serve dir_of_app
goapp deploy dir_of_app - php开发、部署:
appcfg update dir_of_app
下载曾经部署过的代码: appcfg.py download_app -A root-micron-847 myphp (注意: -A 后面的project id 不能写成title哦)