diff --git a/README.md b/README.md index b1861e9..c0e524c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/laminar.conf b/laminar.conf index 7f1e776..1e53a5d 100644 --- a/laminar.conf +++ b/laminar.conf @@ -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 diff --git a/src/laminar.cpp b/src/laminar.cpp index 67534e5..5b8de1a 100644 --- a/src/laminar.cpp +++ b/src/laminar.cpp @@ -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); diff --git a/src/laminar.h b/src/laminar.h index 0c39ae9..06fa313 100644 --- a/src/laminar.h +++ b/src/laminar.h @@ -85,7 +85,7 @@ private: std::string homeDir; std::set clients; std::set waiters; - bool eraseWorkdir; + bool eraseRunDir; std::string archiveUrl; };