大部分在文檔上都寫了, 寫這篇文章的目的是發現如今appcfg.py update xxxx
的時候會打開瀏覽器訪問google請求受權(後臺內建了一個本地server, 端口是8090
, 受權成功後會帶受權碼請求本地的8090端口, 因此咱們在 ssh 環境中是沒有瀏覽器的, 該怎麼解決呢?html
我玩 linux 很少, 就以個人知識量這麼解決:linux
127.0.0.1:8090
, 固然, 什麼都不會發生, 但從地址欄裏把地址複製到剪貼板.ctrl+z
)curl
訪問剪貼板裏的地址ctrl+z
把curl
請求放到後臺jobs
命令查一下, 若是後臺沒有別的任務的話, appcfg
任務的id 應該是1, curl
任務id 應該是2(如今以個人1和2爲準)appcfg
提到前臺: fg %1
fg %2
把 curl 任務提到前臺, 你會看到提示, 什麼受權成功之類的演示:(有更好的方法歡迎指教)web
root@walker:~/KindleEar# appcfg.py update app.yaml module-worker.yaml 07:52 AM Host: appengine.google.com 07:52 AM Application: kindleearwalker; version: 1 07:52 AM Starting update of app: kindleearwalker, version: 1 07:52 AM Getting current resource limits. Your browser has been opened to visit: https://accounts.google.com/o/oauth2/auth?scope=演示數據 # step1: 請複製此網址, 並忽略要你退出換電腦的提示 If your browser is on a different machine then exit and re-run this application with the command-line parameter --noauth_local_webserver # step2: 如今開始把任務放到後臺 ^Z [1]+ Stopped appcfg.py update app.yaml module-worker.yaml # step3: 把從本機瀏覽器複製的回調 url 訪問一下 root@walker:~/KindleEar# curl http://localhost:8090/?code=4/xxxxxx# # step4: 把訪問任務放到後臺 ^Z [2]+ Stopped curl http://localhost:8090/?code=4/xxxxxx# # step 5: 查看一下任務和 ID root@walker:~/KindleEar# jobs [1]- Stopped appcfg.py update app.yaml module-worker.yaml [2]+ Stopped curl http://localhost:8090/?code=4/xxxxxx# # step 6: 把appcgf的任務提到前臺 root@walker:~/KindleEar# fg %1 appcfg.py update app.yaml module-worker.yaml Authentication successful. 07:54 AM Scanning files on local disk. 07:54 AM Cloning 15 static files. 07:54 AM Cloning 387 application files. 07:54 AM Uploading 3 files and blobs. 07:54 AM Uploaded 3 files and blobs. .........省略 07:54 AM Compilation completed. 07:54 AM Starting deployment. 07:54 AM Checking if deployment succeeded. 07:54 AM Deployment successful. 07:54 AM Checking if updated app version is serving. 07:54 AM Completed update of app: kindleearwalker, module: worker, version: 1 # step 7: see? 成功了, 看看剩下的任務吧 root@walker:~/KindleEar# jobs [2]+ Stopped curl http://localhost:8090/?code=4/xxxxxxx# # step 8: 提到前臺來結束吧 root@walker:~/KindleEar# fg %2 curl http://localhost:8090/?code=4/xxxxxxx# <html><head><title>Authentication Status</title></head><body><p>The authentication flow has completed.</p></body></html>root@walker:~/KindleEar#