Skip to content

Commit

Permalink
ENV for Sentry environment is SENTRY_ENVIRONMENT
Browse files Browse the repository at this point in the history
  • Loading branch information
kilemensi committed Jun 22, 2024
1 parent f6e1414 commit 9fa4a4b
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/charterafrica-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
DOKKU_REMOTE_URL: "ssh://[email protected]/charterafrica"
IMAGE_NAME: "codeforafrica/charterafrica-ui"
NEXT_PUBLIC_APP_URL: "https://charterafrica.dev.codeforafrica.org"
SENTRY_ENV: "development"
SENTRY_ENVIRONMENT: "development"

jobs:
deploy:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.CHARTERAFRICA_SENTRY_DSN }}
PAYLOAD_SECRET_KEY=${{ secrets.CHARTERAFRICA_PAYLOAD_SECRET_KEY }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ENV=${{ env.SENTRY_ENV }}
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.CHARTERAFRICA_SENTRY_PROJECT }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/charterafrica-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
NEXT_PUBLIC_APP_URL: "https://charter.africa"
NEXT_PUBLIC_SEO_DISABLED: "false"
VERSION_FILE_NAME: "./apps/charterafrica/package.json"
SENTRY_ENV: "production"
SENTRY_ENVIRONMENT: "production"

jobs:
deploy:
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
NEXT_PUBLIC_SEO_DISABLED=${{ env.NEXT_PUBLIC_SEO_DISABLED }}
PAYLOAD_SECRET_KEY=${{ secrets.CHARTERAFRICA_PAYLOAD_SECRET_KEY }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ENV=${{ env.SENTRY_ENV }}
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.CHARTERAFRICA_SENTRY_PROJECT }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeforafrica-deploy-dev-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAME: "codeforafrica/codeforafrica-ui"
NEXT_PUBLIC_APP_URL: "https://codeforafrica-ui.dev.codeforafrica.org"
SENTRY_ENV: "development"
SENTRY_ENVIRONMENT: "development"

jobs:
deploy:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
NEXT_PUBLIC_APP_LOGO_URL=${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }}
NEXT_PUBLIC_APP_NAME=${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ENV=${{ env.SENTRY_ENV }}
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.CODEFORAFRICA_SENTRY_PROJECT }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeforafrica-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
IMAGE_NAME: "codeforafrica/codeforafrica-ui"
VERSION_FILE_NAME: "./apps/codeforafrica/package.json"
NEXT_PUBLIC_APP_URL: "https://cfa.dev.codeforafrica.org"
SENTRY_ENV: "production"
SENTRY_ENVIRONMENT: "production"

jobs:
deploy:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
NEXT_PUBLIC_APP_URL=${{ env.NEXT_PUBLIC_APP_URL }}
PAYLOAD_SECRET=${{ secrets.CODEFORAFRICA_PAYLOAD_SECRET }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ENV=${{ env.SENTRY_ENV }}
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.CODEFORAFRICA_SENTRY_PROJECT }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pesayetu-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
IMAGE_NAME: "codeforafrica/pesayetu-ui"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEXT_PUBLIC_APP_URL: "https://pesayetu-ui.dev.codeforafrica.org"
SENTRY_ENV: "development"
SENTRY_ENVIRONMENT: "development"

jobs:
deploy:
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
JWT_SECRET_KEY=${{ secrets.PESAYETU_JWT_SECRET_KEY }}
HURUMAP_API_URL=${{ secrets.PESAYETU_HURUMAP_API_URL }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ENV=${{ env.SENTRY_ENV }}
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.PESAYETU_SENTRY_PROJECT }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/roboshield-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAME: "codeforafrica/roboshield"
NEXT_PUBLIC_APP_URL: "https://roboshield-ui.dev.codeforafrica.org"
SENTRY_ENV: "development"
SENTRY_ENVIRONMENT: "development"

jobs:
deploy:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.CHARTERAFRICA_SENTRY_DSN }}
PAYLOAD_SECRET_KEY=${{ secrets.CHARTERAFRICA_PAYLOAD_SECRET_KEY }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ENV=${{ env.SENTRY_ENV }}
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.ROBOSHIELD_SENTRY_PROJECT }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/vpnmanager-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
env:
DOKKU_REMOTE_URL: "ssh://[email protected]/vpnmanager"
IMAGE_NAME: "codeforafrica/vpnmanager"
SENTRY_ENV: "development"
SENTRY_ENVIRONMENT: "development"

jobs:
deploy:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
build-args: |
SENTRY_DSN=${{ secrets.VPNMANAGER_SENTRY_DSN }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ENV=${{ env.SENTRY_ENV }}
SENTRY_ENVIRONMENT=${{ env.SENTRY_ENVIRONMENT }}
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.VPNMANAGER_SENTRY_PROJECT }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG \
NEXT_PUBLIC_GOOGLE_ANALYTICS="" \
# Sentry (build time)
SENTRY_AUTH_TOKEN \
SENTRY_ENV="" \
SENTRY_ENVIRONMENT="" \
SENTRY_ORG \
SENTRY_PROJECT

Expand Down Expand Up @@ -102,7 +102,7 @@ ENV NODE_ENV=production \
NEXT_PUBLIC_SEO_DISABLED=${NEXT_PUBLIC_SEO_DISABLED} \
NEXT_PUBLIC_GOOGLE_ANALYTICS=${NEXT_PUBLIC_GOOGLE_ANALYTICS} \
PORT=${PORT} \
SENTRY_ENV=${SENTRY_ENV} \
SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT} \
# set hostname to localhost
HOSTNAME="0.0.0.0"

Expand Down Expand Up @@ -151,7 +151,7 @@ ARG NEXT_TELEMETRY_DISABLED \
NEXT_PUBLIC_GOOGLE_ANALYTICS \
# Sentry (build time)
SENTRY_AUTH_TOKEN \
SENTRY_ENV \
SENTRY_ENVIRONMENT \
SENTRY_ORG \
SENTRY_PROJECT \
# Wordpress
Expand Down Expand Up @@ -245,7 +245,7 @@ ARG NEXT_TELEMETRY_DISABLED \
NEXT_PUBLIC_GOOGLE_ANALYTICS \
# Sentry (build time)
SENTRY_AUTH_TOKEN \
SENTRY_ENV \
SENTRY_ENVIRONMENT \
SENTRY_ORG \
SENTRY_PROJECT \
SENTRY_LOG_LEVEL="info"
Expand Down
10 changes: 5 additions & 5 deletions apps/charterafrica/.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
MIGRATIONS_DIR=./migrations
NEXT_PUBLIC_IMAGE_UNOPTIMIZED=true

NEXT_PUBLIC_SEO_DISABLED=true

PAYLOAD_PUBLIC_LOCALES="en, fr, pt"
PAYLOAD_PUBLIC_DEFAULT_LOCALE=en
MIGRATIONS_DIR=./migrations
SENTRY_ENV=local
PAYLOAD_PUBLIC_LOCALES="en, fr, pt"
SENTRY_ENVIRONMENT=local
SENTRY_ORG=code-for-africa
SENTRY_PROJECT=charterafrica
2 changes: 1 addition & 1 deletion apps/charterafrica/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ SENDGRID_FROM_NAME

# https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
NEXT_PUBLIC_SENTRY_DSN=
SENTRY_ENV=local|development|production
SENTRY_ENVIRONMENT=local|development|production
SENTRY_ORG=
SENTRY_PROJECT=
9 changes: 4 additions & 5 deletions apps/codeforafrica/.env
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
MIGRATIONS_DIR=./migrations
NEXT_PUBLIC_APP_DIRECTORY="apps/codeforafrica/"
NEXT_PUBLIC_APP_LOGO_URL=https://res.cloudinary.com/code-for-africa/image/upload/v1656078512/codeforafrica/logos/CfA_logo_BW_twlmo6.png
NEXT_PUBLIC_APP_NAME="Code for Africa"
NEXT_PUBLIC_APP_URL="https://cfa.dev.codeforafrica.org"
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID="G-QVY4THBKNT"
NEXT_PUBLIC_IMAGE_DOMAINS="longform.codeforafrica.org,res.cloudinary.com"
NEXT_PUBLIC_IMAGE_UNOPTIMIZED="true"
NEXT_PUBLIC_VERCEL_URL=${VERCEL_URL}
NEXT_PUBLIC_APP_DIRECTORY="apps/codeforafrica/"
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID="G-QVY4THBKNT"
MIGRATIONS_DIR=./migrations

SENTRY_ENV=local
SENTRY_ENVIRONMENT=local
SENTRY_ORG=code-for-africa
SENTRY_PROJECT=codeforafrica
2 changes: 1 addition & 1 deletion apps/codeforafrica/env.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ S3_ACCESS_KEY_ID=
# Sentry
NEXT_PUBLIC_SENTRY_DSN=
SENTRY_AUTH_TOKEN=
SENTRY_ENV=
SENTRY_ENVIRONMENT=
SENTRY_ORG=
SENTRY_PROJECT=
3 changes: 3 additions & 0 deletions apps/pesayetu/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SENTRY_ENVIRONMENT=local
SENTRY_ORG=code-for-africa
SENTRY_PROJECT=pesayetu
2 changes: 1 addition & 1 deletion apps/roboshield/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SENTRY_ENV=local
SENTRY_ENVIRONMENT=local
SENTRY_ORG=code-for-africa
SENTRY_PROJECT=roboshield
2 changes: 1 addition & 1 deletion apps/roboshield/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PORT
# https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
NEXT_PUBLIC_SENTRY_DSN=
# Defaults to local
SENTRY_ENV=local|development|staging|production
SENTRY_ENVIRONMENT=local|development|staging|production
# Defaults to code-for-africa
SENTRY_ORG=
# Defaults to roboshield
Expand Down
2 changes: 1 addition & 1 deletion apps/vpnmanager/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 1,
environment: process.env.SENTRY_ENV ?? "local",
environment: process.env.SENTRY_ENVIRONMENT ?? "local",
debug: false,
replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
Expand Down
2 changes: 1 addition & 1 deletion apps/vpnmanager/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.SENTRY_ENV ?? "local",
environment: process.env.SENTRY_ENVIRONMENT ?? "local",
tracesSampleRate: 1,
debug: false,
});
2 changes: 1 addition & 1 deletion apps/vpnmanager/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as Sentry from "@sentry/nextjs";

const options = {
dsn: process.env.SENTRY_DSN,
environment: process.env.SENTRY_ENV ?? "local",
environment: process.env.SENTRY_ENVIRONMENT ?? "local",
tracesSampleRate: 1,
};

Expand Down
4 changes: 2 additions & 2 deletions charterafrica.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ARG NEXT_TELEMETRY_DISABLED=1 \
PORT=3000 \
# Sentry config for source maps upload (needed at build time only)
SENTRY_AUTH_TOKEN="" \
SENTRY_ENV="" \
SENTRY_ENVIRONMENT="" \
SENTRY_ORG="" \
SENTRY_PROJECT="" \
# Needed by Payload at Next.js build time (see below for Payload's own
Expand Down Expand Up @@ -99,7 +99,7 @@ ENV NODE_ENV=production \
PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH} \
PAYLOAD_PUBLIC_APP_URL=${PAYLOAD_PUBLIC_APP_URL} \
PORT=${PORT} \
SENTRY_ENV=${SENTRY_ENV}
SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT}

WORKDIR /workspace/apps/charterafrica

Expand Down
4 changes: 2 additions & 2 deletions codeforafrica.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ARG PORT=3000 \
NEXT_PUBLIC_SENTRY_DSN="" \
# Sentry config for source maps upload (needed at build time only)
SENTRY_AUTH_TOKEN="" \
SENTRY_ENV="" \
SENTRY_ENVIRONMENT="" \
SENTRY_ORG="" \
SENTRY_PROJECT=""

Expand Down Expand Up @@ -72,7 +72,7 @@ ENV NODE_ENV=production \
NEXT_PUBLIC_APP_NAME=${NEXT_PUBLIC_APP_NAME} \
NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL} \
NEXT_PUBLIC_SENTRY_DSN=${NEXT_PUBLIC_SENTRY_DSN} \
SENTRY_ENV=${SENTRY_ENV}
SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT}

WORKDIR /workspace/apps/codeforafrica

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
PAYLOAD_SECRET_KEY: ${PAYLOAD_SECRET_KEY}
SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN}
SENTRY_ORG: ${SENTRY_ORG}
SENTRY_ENV: ${SENTRY_ENV}
SENTRY_ENVIRONMENT: ${SENTRY_ENVIRONMENT}
SENTRY_PROJECT: ${SENTRY_PROJECT}
ports:
- 3000:3000
Expand Down Expand Up @@ -50,7 +50,7 @@ services:
PAYLOAD_SECRET: ${PAYLOAD_SECRET}
SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN}
SENTRY_ORG: ${SENTRY_ORG}
SENTRY_ENV: ${SENTRY_ENV}
SENTRY_ENVIRONMENT: ${SENTRY_ENVIRONMENT}
SENTRY_PROJECT: ${SENTRY_PROJECT}
ports:
- 3000:3000
Expand Down
4 changes: 2 additions & 2 deletions roboshield.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ARG NEXT_TELEMETRY_DISABLED=1 \
PORT=3000 \
# Sentry config for source maps upload (needed at build time only)
SENTRY_AUTH_TOKEN="" \
SENTRY_ENV="" \
SENTRY_ENVIRONMENT="" \
SENTRY_ORG="" \
SENTRY_PROJECT=""

Expand Down Expand Up @@ -92,7 +92,7 @@ ENV NODE_ENV=production \
NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL} \
NEXT_PUBLIC_SENTRY_DSN=${NEXT_PUBLIC_SENTRY_DSN} \
PORT=${PORT} \
SENTRY_ENV=${SENTRY_ENV}
SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT}

RUN set -ex \
# Create a non-root user
Expand Down

0 comments on commit 9fa4a4b

Please sign in to comment.