From 3f6177d9cf4e6538d1c8d60b61ab397ef198a6ee Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 11 Oct 2023 18:05:10 +0200 Subject: [PATCH] allow to load predefined configs --- webinstall/cibuild.js | 22 ++++++++++++++++++++++ webinstall/config/nodemcu-homberger.json | 1 + 2 files changed, 23 insertions(+) create mode 100644 webinstall/config/nodemcu-homberger.json diff --git a/webinstall/cibuild.js b/webinstall/cibuild.js index 3ec8ca09..abf67e79 100644 --- a/webinstall/cibuild.js +++ b/webinstall/cibuild.js @@ -768,6 +768,28 @@ class PipelineInfo{ if (! structure){ structure=await loadConfig("build.yaml"); } + let ucfg=getParam('config'); + let loadedCfg=undefined; + if (ucfg){ + ucfg=ucfg.replace(/[^.a-zA-Z_-]/g,''); + if (gitSha !== undefined){ + try{ + loadedCfg=await fetchJson(GITAPI,Object.assign({},gitParam,{sha:gitSha,proxy:'webinstall/config/'+ucfg+".json"})); + }catch(e){ + alert("unable to load config "+ucfg+" for selected release, trying latest"); + } + } + if (loadedCfg === undefined){ + try{ + loadedCfg=await fetchJson('config/'+ucfg+".json"); + }catch(e){ + alert("unable to load config "+ucfg+": "+e); + } + } + if (loadedCfg !== undefined){ + config=loadedCfg; + } + } buildSelectors(ROOT_PATH,structure.config.children,true); if (! isRunning()) findPipeline(); updateStatus(); diff --git a/webinstall/config/nodemcu-homberger.json b/webinstall/config/nodemcu-homberger.json new file mode 100644 index 00000000..f815f3ef --- /dev/null +++ b/webinstall/config/nodemcu-homberger.json @@ -0,0 +1 @@ +{"root:board:serial2":false,"root:board:led":false,"root:board":"nodemcu-generic","root:board:can":true,"root:board:can:tx":5,"root:board:can:rx":4,"root:board:resetButton":true,"root:board:resetButton:button":0,"root:board:resetButton:resetButtonMode":0,"root:board:resetButton:resetButtonPUD":true,"root:board:serial1":true,"root:board:serial1:type":"rx","root:board:serial1:type:RX":16} \ No newline at end of file