rundir could not be kept, use consistent naming

pull/13/head
Oliver Giles 7 years ago
parent f96e58c3f1
commit 32426ee34f

@ -484,7 +484,7 @@ make
- `LAMINAR_BIND_HTTP`: The interface/port or unix socket on which `laminard` should listen for incoming connections to the web frontend. Default `*:8080`
- `LAMINAR_BIND_RPC`: The interface/port or unix socket on which `laminard` should listen for incoming commands such as build triggers. Default `unix-abstract:laminar`
- `LAMINAR_TITLE`: The page title to show in the web frontend.
- `LAMINAR_KEEP_WORKDIR`: If set, do not delete run directories after completion
- `LAMINAR_KEEP_RUNDIR`: If set, do not delete run directories after completion
- `LAMINAR_ARCHIVE_URL`: If set, the web frontend served by `laminard` will use this URL to form links to artefacts archived jobs. Must be synchronized with web server configuration.
### Script execution order

@ -33,12 +33,12 @@
#LAMINAR_TITLE=
###
### LAMINAR_KEEP_WORKDIR
### LAMINAR_KEEP_RUNDIR
###
### If set (to anything), the job workdir $LAMINAR_HOME/run/$JOB/$NUM
### If set (to anything), the job rundir $LAMINAR_HOME/run/$JOB/$RUN
### will not be deleted after the run has completed
###
#LAMINAR_KEEP_WORKDIR=1
#LAMINAR_KEEP_RUNDIR=1
###
### LAMINAR_ARCHIVE_URL

@ -73,7 +73,7 @@ Laminar::Laminar() {
archiveUrl = ARCHIVE_URL_DEFAULT;
if(char* envArchive = getenv("LAMINAR_ARCHIVE_URL"))
archiveUrl = envArchive;
eraseWorkdir = true;
eraseRunDir = true;
homeDir = getenv("LAMINAR_HOME") ?: "/var/lib/laminar";
db = new Database((fs::path(homeDir)/"laminar.sqlite").string().c_str());
@ -370,8 +370,8 @@ void Laminar::stop() {
}
bool Laminar::loadConfiguration() {
if(getenv("LAMINAR_KEEP_WORKDIR"))
eraseWorkdir = false;
if(getenv("LAMINAR_KEEP_RUNDIR"))
eraseRunDir = false;
NodeMap nm;
@ -726,7 +726,8 @@ void Laminar::runFinished(Run * r) {
}
// remove the rundir
fs::remove_all(r->runDir);
if(eraseRunDir)
fs::remove_all(r->runDir);
// will delete the job
activeJobs.get<2>().erase(r);

@ -85,7 +85,7 @@ private:
std::string homeDir;
std::set<LaminarClient*> clients;
std::set<LaminarWaiter*> waiters;
bool eraseWorkdir;
bool eraseRunDir;
std::string archiveUrl;
};

Loading…
Cancel
Save