Skip to content

Commit

Permalink
Fix pipeline build
Browse files Browse the repository at this point in the history
Filter legal files via `type` field

Add `native` to Prisma's `binaryTargets`

Add `pipeline-asset-sg` to the `build` command
  • Loading branch information
daniel-va committed Oct 15, 2024
1 parent 2870beb commit 54dbeb8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions apps/pipeline-asset-sg/src/core/export-to-view.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,16 @@ export class ExportToViewService {
}

/**
* Export files.
* Remove files which start with 'LDoc'
* Export non-legal files.
*/
private async exportFiles(assetIds: number[]) {
log(`Starting file export.`);
// Read all unique file ids from the assetFiles which dont include 'LDoc'
// Read all unique file ids from the assetFiles which are not legal docs.
const assetFiles = await this.sourcePrisma.assetFile.findMany({
where: { assetId: { in: assetIds }, file: { fileName: { not: { contains: 'LDoc' } } } },
where: { assetId: { in: assetIds }, file: { type: { not: 'Legal' } } },
});
const fileIds = [...new Set(assetFiles.map((af) => af.fileId))];
const files = await this.sourcePrisma.file.findMany({ where: { fileId: { in: fileIds } } });
const files = await this.sourcePrisma.file.findMany({ where: { id: { in: fileIds } } });

// Write files to the destination database
const fileResult = await this.destinationPrisma.file.createMany({
Expand Down
2 changes: 1 addition & 1 deletion libs/persistence/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ generator client {
provider = "prisma-client-js"
output = "../../../node_modules/.prisma/client"
previewFeatures = ["views"]
binaryTargets = ["debian-openssl-3.0.x"]
binaryTargets = ["native", "debian-openssl-3.0.x"]
}

datasource db {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start:server": "npx nx serve server-asset-sg",
"start:client": "npx nx serve client-asset-sg",
"start:pipeline": "npx nx serve pipeline-asset-sg --watch false",
"build": "npx nx run-many -t build -p server-asset-sg client-asset-sg --configuration=production",
"build": "npx nx run-many -t build -p server-asset-sg client-asset-sg pipeline-asset-sg --configuration=production",
"build:server": "npx nx build server-asset-sg --configuration=production",
"build:client": "npx nx build client-asset-sg --configuration=production",
"prisma": "dotenv -e apps/server-asset-sg/.env -e apps/server-asset-sg/.env.local -- npx prisma",
Expand Down

0 comments on commit 54dbeb8

Please sign in to comment.