mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
fix(backend): fixes for branding (#8449)
* copy from branding folder to backend public folder provide default branding/public folder * copy public folder correctly * copy files again for providers.json * copy more public folders * more copy * revert change * fix naming of called script when using db:data:branding * prod command for branding data * close database connection * lint fixes * increase test timeout again
This commit is contained in:
parent
fffaebcbca
commit
d7d8a242cd
@ -24,11 +24,12 @@ ONBUILD COPY ./branding/constants/ src/config/tmp
|
||||
ONBUILD RUN tools/replace-constants.sh
|
||||
ONBUILD COPY ./branding/email/ src/middleware/helpers/email/
|
||||
ONBUILD COPY ./branding/data/ src/db/data
|
||||
ONBUILD COPY ./branding/public/ public/
|
||||
ONBUILD RUN yarn install --production=false --frozen-lockfile --non-interactive
|
||||
ONBUILD RUN yarn run build
|
||||
ONBUILD RUN mkdir /build
|
||||
ONBUILD RUN cp -r ./build /build
|
||||
ONBUILD RUN cp -r ./public /build/build
|
||||
ONBUILD RUN cp -r ./public /build
|
||||
ONBUILD RUN cp -r ./package.json yarn.lock /build
|
||||
ONBUILD RUN cd /build && yarn install --production=true --frozen-lockfile --non-interactive
|
||||
|
||||
|
||||
0
backend/branding/public/.gitkeep
Normal file
0
backend/branding/public/.gitkeep
Normal file
@ -19,11 +19,12 @@
|
||||
"db:seed": "ts-node --require tsconfig-paths/register src/db/seed.ts",
|
||||
"db:data:admin": "ts-node --require tsconfig-paths/register src/db/admin.ts",
|
||||
"db:data:badges": "ts-node --require tsconfig-paths/register src/db/badges.ts",
|
||||
"db:data:branding": "ts-node --require tsconfig-paths/register src/db/data-production.ts",
|
||||
"db:data:branding": "ts-node --require tsconfig-paths/register src/db/data-branding.ts",
|
||||
"db:data:categories": "ts-node --require tsconfig-paths/register src/db/categories.ts",
|
||||
"db:migrate": "migrate --compiler 'ts:./src/db/compiler.ts' --migrations-dir ./src/db/migrations --store ./src/db/migrate/store.ts",
|
||||
"db:migrate:create": "migrate --compiler 'ts:./src/db/compiler.ts' --migrations-dir ./src/db/migrations --template-file ./src/db/migrate/template.ts --date-format 'yyyymmddHHmmss' create",
|
||||
"prod:migrate": "migrate --migrations-dir ./build/src/db/migrations --store ./build/src/db/migrate/store.js"
|
||||
"prod:migrate": "migrate --migrations-dir ./build/src/db/migrations --store ./build/src/db/migrate/store.js",
|
||||
"prod:db:data:branding": "node build/src/db/data-branding.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/cli": "~7.27.0",
|
||||
|
||||
@ -1,16 +1,18 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
/* eslint-disable @typescript-eslint/no-floating-promises */
|
||||
import { readdir } from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
|
||||
import { getNeode } from './neo4j'
|
||||
|
||||
const dataFolder = path.join(__dirname, 'data/')
|
||||
const neode = getNeode()
|
||||
|
||||
;(async function () {
|
||||
const files = await readdir(dataFolder)
|
||||
files.forEach(async (file) => {
|
||||
for await (const file of files) {
|
||||
if (file.slice(0, -3).endsWith('-branding')) {
|
||||
const importedModule = await import(path.join(dataFolder, file))
|
||||
if (!importedModule.default) {
|
||||
@ -18,5 +20,8 @@ const dataFolder = path.join(__dirname, 'data/')
|
||||
}
|
||||
await importedModule.default()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// close database connection
|
||||
neode.close()
|
||||
})()
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
// Metascraper takes longer nowadays, double time
|
||||
// jest.setTimeout(10000)
|
||||
jest.setTimeout(10000)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user