Initial commit

This commit is contained in:
2025-10-02 08:54:03 +02:00
commit ea54638227
1642 changed files with 53677 additions and 0 deletions

16
api/jobs/lighthouse.js Normal file
View File

@@ -0,0 +1,16 @@
var { setUpQuery, calculateAverageDynamically, run } = require("../hooks/lib/utils")
;(function () {
console.log("Running lighthouse job")
let subPaths = context.db.find("lighthouseSubpath")
let urls = []
for (let i = 0; i < subPaths.length; i++) {
urls.push(setUpQuery(subPaths[i].lighthouseSubpath))
}
let dbObjs = []
urls.forEach((url) => {
dbObjs.push(run(url))
})
let dbObject = calculateAverageDynamically(dbObjs)
dbObject.analyzedPaths = [...subPaths].map((subPath) => subPath.lighthouseSubpath)
context.db.create("lighthouse", dbObject)
})()

14
api/jobs/lighthouse.yml Normal file
View File

@@ -0,0 +1,14 @@
# Jedem Job muss ein "cron" Eintrag zugeordnet werden, der die
# Ausführungszeitpunkte definiert.
# Das cron-Schema ist dem üblichen Linux cron-Schema nachempfunden.
cron: "0 0 * * 1"
# "type" des Jobs ist derzeit immer "javascript" mit der "file"-Referenz
# relativ zur "config.yml".
type: javascript
file: jobs/lighthouse.js
# Es können beliebige "meta"-Daten hinterlegt werden, die im Javascript
# des Jobs über "context.job.meta" abgerufen werden können.
meta:
name: Lighthouse job