You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases we would like to run a same command for multiples parameters. Currently it is possible using a "for loop" (in bash, or xonsh, etc) or using jinja2 "for loop".
it would be nice to do that using a matrix strategy, similar to what github actions does (for a entire job).
NOTE: matrix will be implemented just for "task scope".
Example:
version: 1.0.0
groups:
main:
env-file: .env
tasks:
print:
help: print the values from a matrix strategy
matrix:
mytext:
- text1
- text2
- text3
run: echo {{ matrix.mytext }}
when the command makim main.print is executed, it will run "echo" for each value in mytext list.
if more variables is defined in the matrix, it will run the run section for all the combination of variables.
the values for each variable in the matrix, should be a list
The text was updated successfully, but these errors were encountered:
so maybe we just need to wrap-up the final section:
FORVARSINMATRIX: # THIS LINE IS A PSEUDOCODEUPDATE_MATRIX_VARS() # THIS LINE IS A PSEUDOCODEifself.verbose:
MakimLogs.print_info('='*width)
MakimLogs.print_info(
'TARGET: '+f'{self.group_name}.{self.task_name}'
)
MakimLogs.print_info('ARGS:')
MakimLogs.print_info(pprint.pformat(args_input))
MakimLogs.print_info('VARS:')
MakimLogs.print_info(pprint.pformat(variables))
MakimLogs.print_info('ENV:')
MakimLogs.print_info(str(env))
IFMATRIX:
MakimLogs.print_info('MATRIX:')
MakimLogs.print_info(str(matrix_vars))
MakimLogs.print_info('-'*width)
MakimLogs.print_info('>>> '+cmd.replace('\n', '\n>>> '))
MakimLogs.print_info('='*width)
ifnotself.dry_runandcmd:
self._call_shell_app(cmd)
by wrap-up I mean that that section would be executed inside the matrix. Additionally, in that section it should set the variables from the matrix.
we probably don't need to wrap-up the final lines, they should just run once at the end:
# move back the environment variable to the previous valuesos.environ.clear()
os.environ.update(self.env_scoped)
In some cases we would like to run a same command for multiples parameters. Currently it is possible using a "for loop" (in bash, or xonsh, etc) or using jinja2 "for loop".
it would be nice to do that using a matrix strategy, similar to what github actions does (for a entire job).
NOTE: matrix will be implemented just for "task scope".
Example:
when the command
makim main.print
is executed, it will run "echo" for each value in mytext list.if more variables is defined in the matrix, it will run the
run
section for all the combination of variables.the values for each variable in the matrix, should be a list
The text was updated successfully, but these errors were encountered: