Release Automation

 View Only
  • 1.  custom action to run a javascript

    Posted Nov 28, 2016 03:12 AM

    i am trying to run a javascript using a custom action. I have created a custom action and also uploaded the javascript which i want to execute. At run time, it always executes the script as a shell script and therefore it fails to execute. Is there any way that i could run a javascript using custom action.

     

     

    Given below is the screen dump of script part of the custom action. 

     



  • 2.  Re: custom action to run a javascript

    Posted Nov 28, 2016 05:17 AM

    don't have experience with the RDK, but from the screenshots it looks like it is expecting shell or batch scripts, depending on the OS. 

     

    you might need to look into the SDK



  • 3.  Re: custom action to run a javascript

    Posted Nov 28, 2016 06:28 AM

    I am looking around for SDK and let me see if i could develop my own action which would run my own javascript.



  • 4.  Re: custom action to run a javascript

    Broadcom Employee
    Posted Nov 28, 2016 05:31 AM

    The RDK only supports cli and powershell scripts.  So to run a javascript script you will have to run it from a CLI and for this to work you will need a javascript runtime or engine.  Something like Node.js

     

    Regards

    Billy



  • 5.  Re: custom action to run a javascript

    Posted Nov 28, 2016 06:30 AM

    i may not be able to ensure that node.js is installed on target server. i will have to run my own javascript. please suggest if there is any other possible way.



  • 6.  Re: custom action to run a javascript

    Posted Nov 28, 2016 09:31 AM

    There is a built-in action called "Execute JavaScript code" - is there a reason you're not using this?  You can create an instance of the action in a flow and call it anything you want.  



  • 7.  Re: custom action to run a javascript

    Posted Dec 01, 2016 12:20 AM

    the Execute JavaScript code action does not support file handling. I want to read/write file using my javascript.



  • 8.  Re: custom action to run a javascript

    Broadcom Employee
    Posted Dec 07, 2016 04:12 PM

    How did you determine the action does not support file handling (there's no mention of that in the documentation)?  Did you run into any errors when you attempted to do so?



  • 9.  Re: custom action to run a javascript

    Posted Dec 26, 2016 04:33 AM

    the custom action using RDK did not allow to run javascript. the script is treated as .sh. i had to use custom action created using SDK.



  • 10.  Re: custom action to run a javascript

    Broadcom Employee
    Posted Jan 03, 2017 06:21 PM

    Amit,

     

    Hello again and happy new year!  A question regarding your latest response -- you said the custom RDK action does not allow running javascript; however, that's not what I was asking.

     

    Let me clarify: I'm talking about the "Execute JavaScript code"  action, which is a built-in action, not a custom RDK action.  Are you saying this built-in "Execute JavaScript code" action does not support file handling, and if so, how did you come to that conclusion?  Did you run into a specific error when you attempted to use that action?

     

    Thanks,
    James