done with dockerizing

This commit is contained in:
Kfir Dayan 2023-04-02 16:40:49 +03:00
parent 85e1f7b863
commit 49b42b83b9
3 changed files with 10 additions and 7 deletions

View file

@ -1,2 +1,4 @@
node_modules
npm-debug.log
src
tmp

View file

@ -1,4 +1,4 @@
FROM node:latest
FROM node:16
# Create app directory
WORKDIR /usr/src/app

View file

@ -40,17 +40,18 @@ class App {
const app = new App();
console.log("Declaring Cron Job every day at 10:00")
const cron = "0 10 * * *" // every day at 10:00
const job = new CronJob(
"* * * * *",
"0 10 * * *", // every day at 10:00,
async () => {
console.log("START")
console.log("Staring a new job")
const outputFileLocation = 'public/maccabi-haifa-fc.ics';
console.log("Getting games from Haifa")
const games = await app.gameSource.getGamesFromHaifa();
console.log("Generating ICS file")
const icsEvents = app.ics.generateIcsOutputFromGames(games);
console.log("Writing ICS file to " + outputFileLocation)
fs.writeFileSync(outputFileLocation, icsEvents);
console.log("END")
console.log("Done")
},
null,
true,