Skip to content

Commit

Permalink
add sentry to ci (#77)
Browse files Browse the repository at this point in the history
* add sentry to ci

Signed-off-by: Mirko Mollik <[email protected]>

* only add sentry in cd

Signed-off-by: Mirko Mollik <[email protected]>

---------

Signed-off-by: Mirko Mollik <[email protected]>
  • Loading branch information
cre8 authored Jul 8, 2024
1 parent 0f6b020 commit 0be2310
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 17 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production

# build the docker image for keycloak
- name: Build Keycloak Docker Image
run: cd deploys/keycloak && docker-compose build keycloak && docker-compose push keycloak

# add the release, build the container and release it with the information for sentry
- name: Build and push images
run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} INPUT_PUSH=true pnpm exec nx affected -t container sentry
run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} INPUT_PUSH=true pnpm exec nx affected -t sentry-release container sentry-deploy
32 changes: 29 additions & 3 deletions apps/holder-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,35 @@
}
}
},
"sentry": {
"dependsOn": ["build"],
"command": "sentry-cli sourcemaps inject --org credhub --project pwa ./dist/apps/holder-app/browser && sentry-cli sourcemaps upload --org credhub --project pwa ./dist/apps/holder-app/browser"
"sentry-release": {
"executor": "nx:run-commands",
"options": {
"commands": [
"pnpm run sentry-cli releases new $(npm --silent run sentry-cli releases propose-version) -o credhub -p pwa",
"pnpm run sentry-cli releases set-commits --auto $(npm --silent run sentry-cli releases propose-version) -o credhub -p pwa",
"pnpm run sentry-cli releases files $(npm --silent run sentry-cli releases propose-version) upload-sourcemaps dist/apps/holder-app/browser -o credhub -p pwa",
"pnpm run sentry-cli releases finalize $(npm --silent run sentry-cli releases propose-version) -o credhub -p pwa"
],
"parallel": false
}
},
"add-sentry-release": {
"executor": "nx:run-commands",
"options": {
"commands": [
"sed -i '' -E \"s/release: 'version',/release: '$(npm --silent run sentry-cli releases propose-version)',/g\" apps/holder-app/src/environments/environment.ts"
],
"parallel": false
}
},
"sentry-deploy": {
"executor": "nx:run-commands",
"options": {
"commands": [
"pnpm run sentry-cli releases deploys $(npm --silent run sentry-cli releases propose-version) new -e production -o credhub -p pwa"
]
},
"dependsOn": ["sentry-release"]
}
}
}
2 changes: 2 additions & 0 deletions apps/holder-app/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ export const environment = {

sentryDsn:
'https://6350a5821ef72c29668bd6ca1697b108@o4507537672830976.ingest.de.sentry.io/4507537674993744',

release: '0f6b02092fb452d2e2afb1408b36ebcce5e8d3b5',
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
],
"scripts": {
"sentry-cli": "sentry-cli"
},
"description": "A monorepo including multiple apps for SSI",
"author": "Mirko Mollik <[email protected]>",
"engines": {
Expand Down Expand Up @@ -41,6 +44,7 @@
"@nx/workspace": "19.3.2",
"@playwright/test": "^1.44.0",
"@schematics/angular": "18.0.1",
"@sentry/cli": "^2.32.1",
"@simplewebauthn/types": "^10.0.0",
"@swc-node/register": "1.9.2",
"@swc/core": "1.5.7",
Expand Down Expand Up @@ -102,7 +106,6 @@
"@sd-jwt/sd-jwt-vc": "^0.7.1",
"@sd-jwt/types": "^0.7.1",
"@sentry/angular": "^8.13.0",
"@sentry/cli": "^2.32.1",
"@simplewebauthn/browser": "^10.0.0",
"@simplewebauthn/server": "^10.0.0",
"@sphereon/did-auth-siop": "^0.6.4",
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0be2310

Please sign in to comment.