Deployment of LanaBot Telegram bot on Google App Engine using web hooks:
- Create a new code repository on Cloud Platform:
Google Cloud Platform -> Development -> Source code
- Connect a local repository:
$ gcloud init
$ git config credential.helper gcloud.sh
$ git remote add google https://source.developers.google.com/p/fuzzylizbot/r/lizbot
- Push changes from local repository to Google Cloud:
$ git add file1 file2
$ git commit -m "commit message"
$ git push --all google
- Deploy the app:
$ gcloud app deploy app.yaml --project <project name> -v <version_id> --verbosity=info
- Open app in the browser to test:
$ gcloud app browse
The configuration file config.ini.example
needs to be renamed and modified:
[Settings]
; Telegram API token, from @Botfather
TOKEN = 74632864382432:AxxxYBFA99Hixo_jTsfsd08J
;Token for webhook URL
HOOK_TOKEN = ab10e773c1fadca323af2a561eedcbb8
; Google App Engine project id
PROJECT_ID = fuzzylizbot
; Open Weather Map API Key
OWM_KEY = daa3171a18d73c8c1c6c5f13c1298331
- Read requests logs from default application:
$ gcloud app logs read --service default --limit 10
- Stream requests logs from the command line:
$ gcloud app logs tail -s default
- Application logs (including logs from Python's logging module) are generated per request, and can be viewed in the console:
- Google Cloud Platform -> Stackdriver logging -> Logs
-
You can also read the applications logs via API
-
Manage application versions from the console:
- List all versions:
$ gloud app versions list
- Delete vesions:
$ gcloud app versions delete v1 v2
- Manage versions using GUI :
- Google Cloud Platform -> App Engine -> Versions