[elbe-devel] [PATCH 3/9] finetuning: add artifact and rm_artifact command to project-finetuning

Torben Hohn torben.hohn at linutronix.de
Wed Nov 28 17:28:58 CET 2018


make it possible to add files generated in project finetuning or
normal target files to the list of build artifacts, that get downloaded
when the elbe build copletes.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/finetuning.py | 35 +++++++++++++++++++++++++++++++++++
 schema/dbsfed.xsd      | 25 +++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 8ba903f0..1aaeda67 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -490,6 +490,41 @@ class ProjCmdAction(FinetuningAction):
 FinetuningAction.register(ProjCmdAction)
 
 
+class ArtifactAction(FinetuningAction):
+
+    tag = 'artifact'
+
+    def __init__(self, node):
+        FinetuningAction.__init__(self, node)
+
+    def execute(self, _log, _buildenv, target):
+        target.images.append('target' + self.node.et.text)
+
+    def execute_prj(self, _log, _buildenv, target, _builddir):
+        target.images.append(self.node.et.text)
+
+
+FinetuningAction.register(ArtifactAction)
+
+
+class RmArtifactAction(FinetuningAction):
+
+    tag = 'rm_artifact'
+
+    def __init__(self, node):
+        FinetuningAction.__init__(self, node)
+
+    def execute(self, _log, _buildenv, _target):
+        raise NotImplementedError("<rm_artifact> may only be "
+                                  "used in <project-finetuning>")
+
+    def execute_prj(self, _log, _buildenv, target, _builddir):
+        target.images.remove(self.node.et.text)
+
+
+FinetuningAction.register(ArtifactAction)
+
+
 def do_finetuning(xml, log, buildenv, target):
 
     if not xml.has('target/finetuning'):
diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index f0b244d8..e0b6eecb 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -1828,6 +1828,15 @@
           </documentation>
         </annotation>
       </element>
+      <element name="artifact" type="rfs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+	    make the named file an artifact. in project-finetuning the path is relative
+	    to the project directory. In normal finetuning, the path is relative to the
+	    target root.
+          </documentation>
+        </annotation>
+      </element>
     </choice>
   </group>
 
@@ -1865,6 +1874,22 @@
           </documentation>
         </annotation>
       </element>
+      <element name="artifact" type="rfs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+	    make the named file an artifact. in project-finetuning the path is relative
+	    to the project directory. In normal finetuning, the path is relative to the
+	    target root.
+          </documentation>
+        </annotation>
+      </element>
+      <element name="rm_artifact" type="rfs:string" minOccurs="0">
+        <annotation>
+          <documentation>
+	    remove a project artifact from the list of artifacts
+          </documentation>
+        </annotation>
+      </element>
     </choice>
   </group>
 
-- 
2.11.0




More information about the elbe-devel mailing list