diff options
| author | Shulhan <ms@kilabit.info> | 2024-04-18 00:40:59 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-04-18 00:40:59 +0700 |
| commit | 51d14a2686c8ec0dbd876312dd76eec54df0d617 (patch) | |
| tree | 80b186f4ae0f002a72391cbdb6f5e7d47b59ca76 /cmd | |
| parent | bea7551fd914534c4f3a49fbb980cc23b559f155 (diff) | |
| download | kamusku-51d14a2686c8ec0dbd876312dd76eec54df0d617.tar.xz | |
all: move the deployment to VPS
Using AppEngine is not flexible and hard to debug.
For example, if we changes the dependecies on module "pakakeh.go"
there is no way to deploy it manually without pusing new commit to
"pakakeh.go" and update the go.mod manually.
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/kamusd/.gcloudignore | 17 | ||||
| -rw-r--r-- | cmd/kamusd/app.yaml | 2 | ||||
| -rw-r--r-- | cmd/kamusku-telegram-bot/.gcloudignore | 17 | ||||
| -rw-r--r-- | cmd/kamusku-telegram-bot/app.yaml | 7 | ||||
| -rw-r--r-- | cmd/kamusku-telegram-bot/main.go | 7 |
5 files changed, 44 insertions, 6 deletions
diff --git a/cmd/kamusd/.gcloudignore b/cmd/kamusd/.gcloudignore new file mode 100644 index 0000000..d1e2c0b --- /dev/null +++ b/cmd/kamusd/.gcloudignore @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2020 M. Shulhan <ms@kilabit.info> +# SPDX-License-Identifier: CC0-1.0 + +# This file specifies files that are *not* uploaded to Google Cloud Platform +# using gcloud. It follows the same syntax as .gitignore, with the addition of +# "#!include" directives (which insert the entries of the given .gitignore-style +# file at that point). +# +# For more information, run: +# $ gcloud topic gcloudignore +# +.gcloudignore +.git +.gitignore +_bin +_www +daftar_kata_dasar diff --git a/cmd/kamusd/app.yaml b/cmd/kamusd/app.yaml index 7823704..7d8a4a4 100644 --- a/cmd/kamusd/app.yaml +++ b/cmd/kamusd/app.yaml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: CC0-1.0 service: default -runtime: go115 +runtime: go121 instance_class: F2 automatic_scaling: max_instances: 1 diff --git a/cmd/kamusku-telegram-bot/.gcloudignore b/cmd/kamusku-telegram-bot/.gcloudignore new file mode 100644 index 0000000..d1e2c0b --- /dev/null +++ b/cmd/kamusku-telegram-bot/.gcloudignore @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2020 M. Shulhan <ms@kilabit.info> +# SPDX-License-Identifier: CC0-1.0 + +# This file specifies files that are *not* uploaded to Google Cloud Platform +# using gcloud. It follows the same syntax as .gitignore, with the addition of +# "#!include" directives (which insert the entries of the given .gitignore-style +# file at that point). +# +# For more information, run: +# $ gcloud topic gcloudignore +# +.gcloudignore +.git +.gitignore +_bin +_www +daftar_kata_dasar diff --git a/cmd/kamusku-telegram-bot/app.yaml b/cmd/kamusku-telegram-bot/app.yaml index c43b2c6..8ce7756 100644 --- a/cmd/kamusku-telegram-bot/app.yaml +++ b/cmd/kamusku-telegram-bot/app.yaml @@ -2,11 +2,10 @@ # SPDX-License-Identifier: CC0-1.0 service: telegram-bot -runtime: go115 +runtime: go121 instance_class: F2 automatic_scaling: max_instances: 1 env_variables: - DEBUG: "2" - TELEGRAM_TOKEN: "1121465148:AAH9vI-DkHUOPGTmy1Js0dxKSHLYIIkXaIE" - TELEGRAM_WEBHOOK_URL: "https://kamusku-telegram-bot.df.r.appspot.com" + TELEGRAM_TOKEN: "1121465148:AAE6Yf0YevYcyC--eCZyMqSpVia-pK5iFM4" + TELEGRAM_WEBHOOK_URL: "https://kamusku.kilabit.info/telegram/webhook" diff --git a/cmd/kamusku-telegram-bot/main.go b/cmd/kamusku-telegram-bot/main.go index c9628c8..cd0151c 100644 --- a/cmd/kamusku-telegram-bot/main.go +++ b/cmd/kamusku-telegram-bot/main.go @@ -16,8 +16,13 @@ import ( func main() { log.SetPrefix("kamusku-telegram-bot: ") + var ( + tgToken = `1121465148:AAE6Yf0YevYcyC--eCZyMqSpVia-pK5iFM4` + tgWebhook = `https://kamusku.kilabit.info/telegram/webhook` + ) + // Use the token and Webhook URL from environment variables. - tgbot, err := kamusd.NewTelegramBot("", "") + tgbot, err := kamusd.NewTelegramBot(tgToken, tgWebhook) if err != nil { log.Fatal(err) } |
