mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
use shorter build vars in traditional style
This commit is contained in:
parent
2dac3e324b
commit
636dfb8651
@ -38,8 +38,8 @@ static int setParams(int argc, char** argv, T& request) {
|
||||
|
||||
int argsConsumed = n;
|
||||
|
||||
char* job = getenv("lJobName");
|
||||
char* num = getenv("lBuildNum");
|
||||
char* job = getenv("JOB");
|
||||
char* num = getenv("RUN");
|
||||
char* reason = getenv("LAMINAR_REASON");
|
||||
|
||||
if(job && num) n+=2;
|
||||
@ -134,8 +134,8 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
auto req = laminar.setRequest();
|
||||
char* eq = strchr(argv[2], '=');
|
||||
char* job = getenv("lJobName");
|
||||
char* num = getenv("lBuildNum");
|
||||
char* job = getenv("JOB");
|
||||
char* num = getenv("RUN");
|
||||
if(job && num && eq) {
|
||||
char* name = argv[2];
|
||||
*eq++ = '\0';
|
||||
@ -146,7 +146,7 @@ int main(int argc, char** argv) {
|
||||
req.getParam().setValue(val);
|
||||
req.send().wait(waitScope);
|
||||
} else {
|
||||
fprintf(stderr, "Missing lJobName and lBuildNum or param is not in the format key=value\n");
|
||||
fprintf(stderr, "Missing $JOB or $RUN or param is not in the format key=value\n");
|
||||
return EINVAL;
|
||||
}
|
||||
} else if(strcmp(argv[1], "lock") == 0) {
|
||||
|
14
src/run.cpp
14
src/run.cpp
@ -97,14 +97,14 @@ bool Run::step() {
|
||||
}
|
||||
|
||||
setenv("PATH", PATH.c_str(), true);
|
||||
setenv("lBuildNum", buildNum.c_str(), true);
|
||||
setenv("lJobName", name.c_str(), true);
|
||||
setenv("RUN", buildNum.c_str(), true);
|
||||
setenv("JOB", name.c_str(), true);
|
||||
if(!node->name.empty())
|
||||
setenv("lNode", node->name.c_str(), true);
|
||||
setenv("lResult", to_string(result).c_str(), true);
|
||||
setenv("lLastResult", to_string(lastResult).c_str(), true);
|
||||
setenv("lWorkspace", (fs::path(laminarHome)/"run"/name/"workspace").string().c_str(), true);
|
||||
setenv("lArchive", (fs::path(laminarHome)/"archive"/name/buildNum.c_str()).string().c_str(), true);
|
||||
setenv("NODE", node->name.c_str(), true);
|
||||
setenv("RESULT", to_string(result).c_str(), true);
|
||||
setenv("LAST_RESULT", to_string(lastResult).c_str(), true);
|
||||
setenv("WORKSPACE", (fs::path(laminarHome)/"run"/name/"workspace").string().c_str(), true);
|
||||
setenv("ARCHIVE", (fs::path(laminarHome)/"archive"/name/buildNum.c_str()).string().c_str(), true);
|
||||
for(auto& pair : params) {
|
||||
setenv(pair.first.c_str(), pair.second.c_str(), false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user