Skip to content

Commit

Permalink
update: run sentry on image build so sourcemap is up to date when run…
Browse files Browse the repository at this point in the history
…ning the bot
  • Loading branch information
Uhuh committed Jun 28, 2024
1 parent 6f67a4a commit b11a012
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
27 changes: 21 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
TOKEN=super_secret_token
DB_NAME=rolebotTest
DB_NAME=postgres_db_name
POSTGRES_URL=postgres://username:password@192.168.1.1:5432/
SYNC_DB=1
SYNC_DB=0

# Sentry basics
SENTRY_DSN=
SENTRY_ORG=
SENTRY_PROJECT=
SENTRY_AUTH_TOKEN=

# Postgres info...
POSTGRES_HOST=192.168.1.1
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_password
POSTGRES_DATABASE=your_database

GUILD_WEBHOOK=
ERROR_WEBHOOK=

# Webhooks are used to log errors.
WEBHOOK_ID=id
WEBHOOK_TOKEN=token_secret
CLIENT_ID=the_bots_id
SHARD_COUNT=1
WEBHOOK_ID=
WEBHOOK_TOKEN=
CLIENT_ID=
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18 as base
FROM node:20 as base

WORKDIR /home/panku/Rolebot

Expand All @@ -9,4 +9,16 @@ RUN yarn install

COPY . .

RUN yarn build
RUN yarn build

RUN curl -sL https://sentry.io/get-cli/ | bash # Download and install sentry-cli

ARG SENTRY_ORG
ARG SENTRY_PROJECT
ARG SENTRY_AUTH_TOKEN

RUN echo "Sentry org: $SENTRY_ORG"
RUN echo "Sentry project: $SENTRY_PROJECT"

RUN sentry-cli sourcemaps inject --org $SENTRY_ORG --project $SENTRY_PROJECT ./build && \
sentry-cli sourcemaps upload --org $SENTRY_ORG --project $SENTRY_PROJECT ./build --auth-token $SENTRY_AUTH_TOKEN
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ version: '3.8'

services:
rolebot-docker:
env_file:
- .env
build:
context: .
dockerfile: Dockerfile
target: base
args:
SENTRY_ORG: ${SENTRY_ORG}
SENTRY_PROJECT: ${SENTRY_PROJECT}
SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN}
volumes:
- ./src:/home/panku/RoleBot/src
restart: always
Expand Down

0 comments on commit b11a012

Please sign in to comment.