ovh/utask

[script] Allow to define environment variables in scripts

rclsilver opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
I would like to provides to my scripts utask task id and resolution id. Currently, i've to give through argv but it could be fine to provide them through environment variables.

Describe the solution you'd like
Currently:

action:
  type: script
  configuration:
    file_path: my_wrapper.sh
    argv:
    - '{{ .task.task_id }}'
    - '{{ .task.resolution_id }}'

Expected:

action:
  type: script
  configuration:
    file_path: my_wrapper.sh
    environment:
       utask_task_id: '{{ .task.task_id }}'
       utask_resolution_id:  '{{ .task.resolution_id }}'

Maybe we could define for all scripts some utask environment variables with informations instead of define manually:

  • task id
  • resolution id
  • template name
  • ...