def cephadm_build_args(self):
return list(self._cli.cephadm_build_arg or [])
+ @property
+ def run_before_commands(self):
+ return list(self._cli.run_before or [])
+
def build_components(self):
if self._cli.components:
return self._cli.components
action="append",
help="Pass additional arguments to cephadm build script.",
)
+ parser.add_argument(
+ "--run-before",
+ action="append",
+ help="Add a RUN command before other actions"
+ )
# selectors
component_selections = [
# aggregated components:
def build(self):
"""Build the container image."""
dlines = [f"FROM {self._ctx.base_image}"]
+ for cmd in self._ctx.run_before_commands:
+ dlines.append(f'RUN {cmd}')
jcount = len(self._jobs)
for idx, (component, job) in enumerate(self._jobs):
num = idx + 1