Skip to content

yoshixi/chatgpt-slack-bot

Repository files navigation

BOLT TYPESCRIPT BOILERPLATE

Setup

Install deno for lint.

brew install deno # mac os

If you cannot use brew, please see the deno official install dox.

Deno installation

Create .env file

cp .env.example .env

Get a slack bot token and slack signing secret and put to .env file. Bolt reference

How to use the bolt?

You can follow the tutorial.

How to deploy to the cloud run

Build a docker image and deploy to the cloud run

Update IAM to use cloud-build to deploy to the cloud-run.

#!/bin/bash

PROJECT_ID=
PROJECT_NUMBER=

roles=(run.admin run.serviceAgent iam.serviceAccountUser) 
for role in $roles; do
  gcloud projects add-iam-policy-binding $PROJECT_ID \
    --member serviceAccount:$PROJECT_NUMBER@cloudbuild.gserviceaccount.com \
    --role roles/$role
done

Run the deploy command.

gcloud builds submit --config cloudbuild.yaml \
      --substitutions=_SLACK_BOT_TOKEN="xoxb-....." \
      --substitutions=_SLACK_SIGNING_SECRET="99712..." \
      --substitutions=_ARTIFACT_REGISTRY_REPO="cloud-run-source-deploy" \
      --substitutions=_IMAGE_NAME="bolt-typescript-boilerplate" \
      --substitutions=_SERVICE_NAME="bolt-typescript-boilerplate"

Troubleshooting

Build and run the application locally with docker

docker build . -f ./docker/app/Dockerfile --tag bolt-typescript-boilerplate
docker run --env-file .env -p 8080:8080 -t bolt-typescript-boilerplate:latest

If you want to pull a docker image from GCR, you need to update the local docker configuration.

gcloud auth configure-docker us-west1-docker.pkg.dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published