diff --git a/post.py b/post.py
index 8b04ffa..8fe2f27 100644
--- a/post.py
+++ b/post.py
@@ -63,17 +63,17 @@ def post(source,target,env):
for f in glob.glob(os.path.join(outdir,base+"*.bin")):
print("removing old file %s"%f)
os.unlink(f)
- ofversion=''
- if not version.startswith('dev'):
- ofversion="-"+version
- versionedFile=os.path.join(outdir,"%s%s-update.bin"%(base,ofversion))
- shutil.copyfile(firmware,versionedFile)
- outfile=os.path.join(outdir,"%s%s-all.bin"%(base,ofversion))
+ outfile=os.path.join(outdir,"%s-all.bin"%(base))
cmd=[python,esptool,"--chip",chip,"merge_bin","--target-offset",offset,"-o",outfile]
cmd+=uploadfiles
cmd+=[appoffset,firmware]
print("running %s"%" ".join(cmd))
env.Execute(" ".join(cmd),"#testpost")
+ ofversion="-"+version
+ versionedFile=os.path.join(outdir,"%s%s-update.bin"%(base,ofversion))
+ shutil.copyfile(firmware,versionedFile)
+ versioneOutFile=os.path.join(outdir,"%s%s-all.bin"%(base,ofversion))
+ shutil.copyfile(outfile,versioneOutFile)
env.AddPostAction(
"$BUILD_DIR/${PROGNAME}.bin",
post
diff --git a/webinstall/cibuild.css b/webinstall/cibuild.css
index fcf5312..76c8f38 100644
--- a/webinstall/cibuild.css
+++ b/webinstall/cibuild.css
@@ -35,6 +35,10 @@
width: 10em;
opacity: 0.6;
padding: 0;
+ flex-shrink: 0;
+}
+.configui .row .value{
+ padding-left: 0;
}
.configui .since {
display: block;
diff --git a/webinstall/cibuild.html b/webinstall/cibuild.html
index 112a8a6..36ac0fa 100644
--- a/webinstall/cibuild.html
+++ b/webinstall/cibuild.html
@@ -18,6 +18,10 @@
GitSha
---
+
+ Version
+
+
@@ -27,11 +31,11 @@
Error
diff --git a/webinstall/cibuild.js b/webinstall/cibuild.js
index daaaf0b..6c3b214 100644
--- a/webinstall/cibuild.js
+++ b/webinstall/cibuild.js
@@ -51,6 +51,7 @@ class PipelineInfo{
let displayMode='last';
let delayedSearch=undefined;
let gitSha=undefined;
+ let buildVersion=undefined;
const modeStrings={
last: 'Last Build',
existing: 'Existing Build',
@@ -73,15 +74,20 @@ class PipelineInfo{
setVisible('download',currentPipeline.valid() && currentPipeline.downloadUrl!==undefined,true);
setVisible('status_url',currentPipeline.valid() && currentPipeline.status_url!==undefined,true);
setVisible('error',currentPipeline.error!==undefined,true);
- let e=document.getElementById('configError');
- if (e.textContent) {
+ let values={};
+ fillValues(values,['configError','environment']);
+ if (values.textContent) {
+ enableEl('start',false);
+ return;
+ }
+ if (!values.environment){
enableEl('start',false);
return;
}
if (displayMode != 'existing'){
if (currentPipeline.valid()){
//check pipeline state
- if (['error','success','canceled'].indexOf(currentPipeline.status) >= 0){
+ if (['error','success','canceled','failed'].indexOf(currentPipeline.status) >= 0){
enableEl('start',true);
return;
}
@@ -91,8 +97,9 @@ class PipelineInfo{
enableEl('start',true);
return;
}
- //display node existing
- enableEl('start',!currentPipeline.valid());
+ //display mode existing
+ //allow start if either no pipeline or not running and status != success
+ enableEl('start',!currentPipeline.valid() || (!currentPipeline.isRunning() && currentPipeline.status != "success"));
}
const isRunning=()=>{
return currentPipeline.isRunning();
@@ -154,10 +161,13 @@ class PipelineInfo{
updateStatus();
if (gitSha !== undefined) param.tag=gitSha;
param.config=JSON.stringify(config);
+ if (buildVersion !== undefined){
+ param.suffix="-"+buildVersion;
+ }
fetchJson(API,Object.assign({
api:'start'},param))
.then((json)=>{
- let status=json.status || 'error';
+ let status=json.status || json.state|| 'error';
if (status === 'error'){
currentPipeline.update({status:status,error:json.error})
updateStatus();
@@ -367,8 +377,10 @@ class PipelineInfo{
}
}
}
- document.getElementById('environment').value=environment;
- document.getElementById('buildflags').value=flags;
+ if (buildVersion !== undefined){
+ flags+=" -DGWRELEASEVERSION="+buildVersion;
+ }
+ setValues({environment:environment,buildflags:flags});
//check resources
for (let k in currentResources){
let resList=currentResources[k];
@@ -484,6 +496,26 @@ class PipelineInfo{
else{
setValue('gitSha',gitSha);
}
+ let bot=document.getElementById('branchOrTag');
+ let botv=document.getElementById('branchOrTagValue');
+ if (bot && botv){
+ let type=bot.textContent;
+ let val=botv.textContent;
+ if (type && val){
+ if (type != 'release' && type != 'tag'){
+ val=type+val;
+ }
+ val=val.replace(/[:.]/g,'_');
+ val=val.replace(/[^a-zA-Z0-9_]*/g,'');
+ if (val.length > 32){
+ val=val.substring(val.length-32)
+ }
+ if (val.length > 0){
+ buildVersion=val;
+ setValue('buildVersion',buildVersion);
+ }
+ }
+ }
if (gitSha !== undefined){
let url=buildUrl(GITAPI,Object.assign({},gitParam,{sha:gitSha,proxy:'webinstall/build.yaml'}));
try{
diff --git a/webinstall/helper.js b/webinstall/helper.js
index 68dce53..708baaa 100644
--- a/webinstall/helper.js
+++ b/webinstall/helper.js
@@ -50,7 +50,8 @@ const fillValues=(values,items)=>{
items.forEach((it)=>{
let e=document.getElementById(it);
if (e){
- values[it]=e.value; //TODO: type of el
+ if (e.tagName == 'INPUT') values[it]=e.value;
+ if (e.tagName == 'DIV' || e.tagName == 'SPAN') values [it]=e.textContent;
}
})
};