[elbe-devel] [PATCH v2 3/8] finetuning: add artifact and rm_artifact command to project-finetuning
Torben Hohn
torben.hohn at linutronix.de
Wed Dec 5 09:54:07 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 | 23 +++++++++++++++++++++++
2 files changed, 58 insertions(+)
diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 9fc0a2eb..e2ad0c8c 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 145d427a..55b1bb6d 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -1847,6 +1847,14 @@
</documentation>
</annotation>
</element>
+ <element name="artifact" type="rfs:string" minOccurs="0">
+ <annotation>
+ <documentation>
+ make the named file an artifact. The path is relative to the
+ target root.
+ </documentation>
+ </annotation>
+ </element>
</choice>
</group>
@@ -1884,6 +1892,21 @@
</documentation>
</annotation>
</element>
+ <element name="artifact" type="rfs:string" minOccurs="0">
+ <annotation>
+ <documentation>
+ Make the named file an artifact. The path is relative
+ to the project directory.
+ </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