Skip to content

Commit ecea995

Browse files
CopilotLiliDeng
andauthored
Add documentation for script_file transformer (#3826)
* Initial plan for issue * Add documentation for script_file transformer Co-authored-by: LiliDeng <10083705+LiliDeng@users.noreply.github.com> * Update documentation to clarify script_file transformer only supports bash Co-authored-by: LiliDeng <10083705+LiliDeng@users.noreply.github.com> * Update docs to correct order of package installation and script execution Co-authored-by: LiliDeng <10083705+LiliDeng@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: LiliDeng <10083705+LiliDeng@users.noreply.github.com>
1 parent 7c6d1c6 commit ecea995

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

docs/run_test/transformers.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,79 @@ restore
400400
type: bool | Default: false
401401

402402
VM is stopped for exporting VHD. Restore can be set to true to start the VM after exporting.
403+
404+
405+
Use Script File Transformer
406+
~~~~~~~~~~~~~~~~~~~~~~~~~~
407+
408+
This transformer is used to install required packages, execute scripts on a node, and optionally reboot the node after execution.
409+
410+
Usage
411+
``````
412+
.. code:: yaml
413+
414+
transformer:
415+
- type: script_file
416+
phase: expanded
417+
connection:
418+
address: $(build_vm_address)
419+
private_key_file: $(admin_private_key_file)
420+
reboot: true
421+
dependent_packages:
422+
- git
423+
scripts:
424+
- script: "/tmp/waagent.sh"
425+
interpreter: bash
426+
args: "--flag"
427+
expected_exit_code: 0
428+
429+
Outputs
430+
````````
431+
- results
432+
433+
Reference
434+
`````````
435+
436+
dependent_packages
437+
^^^^^^^^^^^^^^^^^
438+
type: List[str] | Default: []
439+
440+
List of packages to install before executing scripts.
441+
442+
scripts (Required)
443+
^^^^^^^^^^^^^^^
444+
type: List[ScriptEntry]
445+
446+
List of scripts to execute on the node.
447+
448+
Script Entry Properties:
449+
450+
script (Required)
451+
""""""""""""""""
452+
type: string
453+
454+
Path to the script file on the target node.
455+
456+
interpreter
457+
""""""""""
458+
type: string | Default: "bash"
459+
460+
Interpreter to use for executing the script. Currently only bash is supported.
461+
462+
args
463+
""""
464+
type: string | Default: None
465+
466+
Arguments to pass to the script.
467+
468+
expected_exit_code
469+
""""""""""""""""
470+
type: int | Default: 0
471+
472+
Expected exit code of the script. If the script returns a different exit code, execution will fail.
473+
474+
reboot
475+
^^^^^
476+
type: bool | Default: false
477+
478+
Reboot the node after script execution.

0 commit comments

Comments
 (0)