Skip to content

Commit

Permalink
chore: data generation reduced to only needed data
Browse files Browse the repository at this point in the history
  • Loading branch information
dmijatovic committed Jul 5, 2024
1 parent 4de62a4 commit a20f8af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
13 changes: 7 additions & 6 deletions data-generation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

FROM node:21.4.0-bullseye-slim
WORKDIR /usr/app
COPY ./package.json /usr/app
RUN npm install
COPY ./img /usr/app/img
COPY ./images.js /usr/app
COPY ./real-data.js /usr/app
COPY ./main.js /usr/app
# copy
COPY package.json package-lock.json ./
# install
RUN npm install --frozen-lockfile --silent
# copy all files
COPY . .

CMD npx wait-on --timeout 10000 $POSTGREST_URL && node main.js
6 changes: 3 additions & 3 deletions data-generation/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ console.log("mentions...", idsMentions.length)
const [
// idsSoftware,
idsProjects,
idsNews,
// idsNews,
idsMeta
] = await Promise.all([
// generateSoftware({orcids,idsMentions}),
generateProject({orcids,idsMentions}),
generateNews(),
// generateNews(),
generateMetaPages()
])

// console.log("software...", idsSoftware.length)
console.log("projects...", idsProjects.length)
console.log("news...", idsNews.length)
// console.log("news...", idsNews.length)
console.log("meta pages...", idsMeta.length)

// organisations and communities
Expand Down
1 change: 1 addition & 0 deletions data-generation/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {headers} from './auth.js';

const usedLowerCaseStrings = new Set();

// demo url https://ubuntu2204sudo.demo-nlesc.src.surf-hosted.nl/
const backendUrl = process.env.POSTGREST_URL || 'http://localhost/api/v1';

export async function postToBackend(endpoint, body) {
Expand Down

0 comments on commit a20f8af

Please sign in to comment.