mirror of
https://github.com/zebrajr/Reactive-Resume.git
synced 2025-12-06 12:20:18 +01:00
add release version to sentry ci process
This commit is contained in:
parent
e36fbb5f64
commit
ea2aee2d25
|
|
@ -2,6 +2,12 @@
|
||||||
TURBO_TEAM=
|
TURBO_TEAM=
|
||||||
TURBO_TOKEN=
|
TURBO_TOKEN=
|
||||||
|
|
||||||
|
# Sentry Error Logging (Optional)
|
||||||
|
SENTRY_ORG=reactive-resume
|
||||||
|
SENTRY_AUTH_TOKEN=
|
||||||
|
SERVER_SENTRY_DSN=
|
||||||
|
PUBLIC_CLIENT_SENTRY_DSN=
|
||||||
|
|
||||||
# Server + Client
|
# Server + Client
|
||||||
TZ=UTC
|
TZ=UTC
|
||||||
PUBLIC_URL=http://localhost:3000
|
PUBLIC_URL=http://localhost:3000
|
||||||
|
|
|
||||||
10
.github/workflows/docker-build-push.yml
vendored
10
.github/workflows/docker-build-push.yml
vendored
|
|
@ -48,6 +48,16 @@ jobs:
|
||||||
username: $GITHUB_REPOSITORY_OWNER
|
username: $GITHUB_REPOSITORY_OWNER
|
||||||
password: ${{ secrets.GH_TOKEN }}
|
password: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create Sentry Release
|
||||||
|
uses: getsentry/action-release@v1.2.1
|
||||||
|
env:
|
||||||
|
SENTRY_ORG: reactive-resume
|
||||||
|
SENTRY_PROJECT: ${{ matrix.image }}
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
with:
|
||||||
|
environment: production
|
||||||
|
version: ${{ steps.version.outputs.current-version }}
|
||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
uses: docker/build-push-action@v3.2.0
|
uses: docker/build-push-action@v3.2.0
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
import env from '@beam-australia/react-env';
|
import env from '@beam-australia/react-env';
|
||||||
import * as Sentry from '@sentry/nextjs';
|
import * as Sentry from '@sentry/nextjs';
|
||||||
|
|
||||||
const SENTRY_DSN = env('CLIENT_SENTRY_DSN');
|
import packageJSON from '../package.json';
|
||||||
|
|
||||||
console.log(SENTRY_DSN);
|
const SENTRY_DSN = env('CLIENT_SENTRY_DSN');
|
||||||
|
|
||||||
if (SENTRY_DSN) {
|
if (SENTRY_DSN) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: SENTRY_DSN,
|
dsn: SENTRY_DSN,
|
||||||
tracesSampleRate: 1.0,
|
tracesSampleRate: 1.0,
|
||||||
|
release: packageJSON.version,
|
||||||
enabled: process.env.NODE_ENV === 'production',
|
enabled: process.env.NODE_ENV === 'production',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
import env from '@beam-australia/react-env';
|
import env from '@beam-australia/react-env';
|
||||||
import * as Sentry from '@sentry/nextjs';
|
import * as Sentry from '@sentry/nextjs';
|
||||||
|
|
||||||
|
import packageJSON from '../package.json';
|
||||||
|
|
||||||
const SENTRY_DSN = env('CLIENT_SENTRY_DSN');
|
const SENTRY_DSN = env('CLIENT_SENTRY_DSN');
|
||||||
|
|
||||||
if (SENTRY_DSN) {
|
if (SENTRY_DSN) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: SENTRY_DSN,
|
dsn: SENTRY_DSN,
|
||||||
tracesSampleRate: 1.0,
|
tracesSampleRate: 1.0,
|
||||||
|
release: packageJSON.version,
|
||||||
enabled: process.env.NODE_ENV === 'production',
|
enabled: process.env.NODE_ENV === 'production',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
"version": "3.6.14",
|
"version": "3.6.14",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "env-cmd --silent turbo run dev",
|
"dev": "env-cmd --silent cross-var cross-env VERSION=$npm_package_version turbo run dev",
|
||||||
"lint": "turbo run lint",
|
"lint": "turbo run lint",
|
||||||
"build": "env-cmd --silent turbo run build",
|
"build": "env-cmd --silent cross-var cross-env VERSION=$npm_package_version turbo run build",
|
||||||
"start": "env-cmd --silent turbo run start",
|
"start": "env-cmd --silent cross-var cross-env VERSION=$npm_package_version turbo run start",
|
||||||
"format": "prettier --write ."
|
"format": "prettier --write ."
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
|
@ -15,6 +15,8 @@
|
||||||
"server"
|
"server"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"cross-var": "^1.1.0",
|
||||||
"env-cmd": "^10.1.0",
|
"env-cmd": "^10.1.0",
|
||||||
"turbo": "^1.6.3"
|
"turbo": "^1.6.3"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
887
pnpm-lock.yaml
887
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
|
@ -2,6 +2,7 @@ import { registerAs } from '@nestjs/config';
|
||||||
|
|
||||||
export default registerAs('app', () => ({
|
export default registerAs('app', () => ({
|
||||||
timezone: process.env.TZ,
|
timezone: process.env.TZ,
|
||||||
|
version: process.env.VERSION,
|
||||||
environment: process.env.NODE_ENV,
|
environment: process.env.NODE_ENV,
|
||||||
secretKey: process.env.SECRET_KEY,
|
secretKey: process.env.SECRET_KEY,
|
||||||
port: parseInt(process.env.PORT, 10) || 3100,
|
port: parseInt(process.env.PORT, 10) || 3100,
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ const validationSchema = Joi.object({
|
||||||
// App
|
// App
|
||||||
TZ: Joi.string().default('UTC'),
|
TZ: Joi.string().default('UTC'),
|
||||||
PORT: Joi.number().default(3100),
|
PORT: Joi.number().default(3100),
|
||||||
|
VERSION: Joi.string().required(),
|
||||||
SECRET_KEY: Joi.string().required(),
|
SECRET_KEY: Joi.string().required(),
|
||||||
NODE_ENV: Joi.string().valid('development', 'production').default('development'),
|
NODE_ENV: Joi.string().valid('development', 'production').default('development'),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,12 @@ const bootstrap = async () => {
|
||||||
|
|
||||||
// Sentry Error Logging
|
// Sentry Error Logging
|
||||||
const sentryDSN = configService.get<string>('logging.sentryDSN');
|
const sentryDSN = configService.get<string>('logging.sentryDSN');
|
||||||
|
const version = configService.get<string>('app.version');
|
||||||
|
|
||||||
if (sentryDSN) {
|
if (sentryDSN) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: sentryDSN,
|
dsn: sentryDSN,
|
||||||
|
release: version,
|
||||||
tracesSampleRate: 1.0,
|
tracesSampleRate: 1.0,
|
||||||
enabled: process.env.NODE_ENV === 'production',
|
enabled: process.env.NODE_ENV === 'production',
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user