1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-10-18 09:04:42 +00:00

allow setting a job description

adding DESCRIPTION=foo to $JOBNAME.conf will display "foo"
in the job overview page on the frontend

Resolves #97
This commit is contained in:
Oliver Giles
2019-12-24 22:10:16 +02:00
parent 40b708c594
commit 2bf04d8157
7 changed files with 37 additions and 2 deletions

View File

@@ -317,7 +317,8 @@ std::string Laminar::getStatus(MonitorScope scope) {
j.set("number", build).set("started", started);
j.EndObject();
});
auto desc = jobDescriptions.find(scope.job);
j.set("description", desc == jobDescriptions.end() ? "" : desc->second);
} else if(scope.type == MonitorScope::ALL) {
j.startArray("jobs");
db->stmt("SELECT name,number,startedAt,completedAt,result FROM builds b JOIN (SELECT name n,MAX(number) l FROM builds GROUP BY n) q ON b.name = q.n AND b.number = q.l")
@@ -543,6 +544,10 @@ bool Laminar::loadConfiguration() {
ctxPtnList.insert(ctx);
jobContexts[jobName].swap(ctxPtnList);
}
std::string desc = conf.get<std::string>("DESCRIPTION");
if(!desc.empty()) {
jobDescriptions[jobName] = desc;
}
}
}