Archi Forum

Archi Plug-ins => jArchi => Topic started by: raphaelha on May 25, 2023, 20:40:34 PM

Title: jArchi start Terraform or any Windows command
Post by: raphaelha on May 25, 2023, 20:40:34 PM
Hi everyone,

sorry for the super noob question  :-\ .

On a Windows computer I've installed Terraform which is a simple .exe file in a folder. Through the PATH variable the folder location could be omitted.

I would like to use a jArchi script that calls the terraform command (actually any installed command: e.g., curl to get files, or scp to copy the ArchiMate Modell somewhere remote) with a trailing input such as "plan, apply, etc." Whereas the output of the command is displayed in the Scripts console window (stdout, stderr -> basically everything so the user receives visual feedback of what the command is doing).

Thanks to everyone, who might be able to help and sorry for my lack of JS skills.


Best regards,
Raphael
Title: Re: jArchi start Terraform or any Windows command
Post by: Phil Beauvoir on May 25, 2023, 20:50:20 PM
Hi, you could try the $.child_process.exec() command:

https://github.com/archimatetool/archi-scripting-plugin/wiki/The-Console%2C-Dialogs-and-Other-Utilities#child_processexec-was-exec

Phil
Title: Re: jArchi start Terraform or any Windows command
Post by: raphaelha on May 27, 2023, 05:37:24 AM
Hi Phil,

awesome!
Thanks for the quick response, I'll give it a try.


Best regards,
Raphael