Skip to content

Commit

Permalink
Merge pull request #610 from tradingstrategy-ai/609-improve-sentry
Browse files Browse the repository at this point in the history
Improve Sentry integration
  • Loading branch information
kenkunz authored Oct 19, 2023
2 parents 322695c + 23c8542 commit 4122474
Show file tree
Hide file tree
Showing 13 changed files with 622 additions and 203 deletions.
52 changes: 41 additions & 11 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ on:
pull_request: # we can use docker image in PR for testing
branches: [master]

env:
REGISTRY: ghcr.io

jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18.14
Expand All @@ -25,12 +28,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up SSH deploy keys for ChartIQ & fonts
uses: webfactory/ssh-agent@v0.7.0
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: |
${{ secrets.SSH_DEPLOY_KEY_CHARTIQ }}
${{ secrets.SSH_DEPLOY_KEY_FONTS }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-node@v3
Expand All @@ -56,33 +59,31 @@ jobs:
# needs: test
# Skip build on master push
if: github.event_name != 'push' || github.ref != 'refs/heads/master'
env:
REGISTRY: ghcr.io
steps:
- name: Set up SSH deploy keys for ChartIQ & fonts
uses: webfactory/ssh-agent@v0.7.0
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: |
${{ secrets.SSH_DEPLOY_KEY_CHARTIQ }}
${{ secrets.SSH_DEPLOY_KEY_FONTS }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Read metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
- name: Log in to Github Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
ssh: |
Expand All @@ -96,3 +97,32 @@ jobs:
# https://github.com/docker/build-push-action/issues/557
build-args: |
FONT_ZIP_DOWNLOAD_URL=${{ secrets.FONT_ZIP_DOWNLOAD_URL }}
upload-sourcemaps:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Read metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
flavor: latest=false
- name: Log in to Github Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Upload sourcemaps
env:
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
SENTRY_URL: ${{ vars.SENTRY_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_RELEASE: ${{ vars.SENTRY_PROJECT }}@${{ steps.meta.outputs.version }}
run: |
docker run --rm -e SENTRY_ORG -e SENTRY_PROJECT -e SENTRY_URL -e SENTRY_AUTH_TOKEN \
${{ steps.meta.outputs.tags }} \
npx sentry-cli sourcemaps upload -r $SENTRY_RELEASE build/client build/server/chunks
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/build ./build
COPY --from=builder /app/scripts/server.js ./scripts/

# Copy root CAs (needed to run sentry-cli)
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

EXPOSE 3000

# See if increase libuv thread pool size makes performance better
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
- TS_PUBLIC_FRONTEND_VERSION_TAG
- TS_PUBLIC_BACKEND_URL
- TS_PUBLIC_BACKEND_INTERNAL_URL
- TS_PUBLIC_SENTRY_DSN
- TS_PUBLIC_GHOST_CONTENT_API_KEY
- TS_PUBLIC_GHOST_API_URL
- TS_PUBLIC_TYPESENSE_API_KEY
Expand All @@ -37,7 +38,6 @@ services:
- TS_PRIVATE_MAILERLITE_URL
- TS_PRIVATE_MAILERLITE_API_KEY
- TS_PRIVATE_MAILERLITE_GROUPS
- TS_PRIVATE_SENTRY_DSN
# https://www.npmjs.com/package/@trading-strategy-ai/web-top-node
- TOP_WEB_API_KEY
# Datadog APM env vars
Expand Down
Loading

0 comments on commit 4122474

Please sign in to comment.