Development process for script runner scripts (COSMOS 5) #1715
Replies: 3 comments
-
Lots of comments :)
If you want to edit outside ScriptRunner in VS Code, that's fine, but currently you will need to rebuild the plugin and then "upgrade" it from the Admin tab. This will work, but the problem you may be running into is leftover edited versions of the script that are "winning" versus the new version you built into the plugin. To fix that, you'll need to open the edited script in ScriptRunner (should have a * by its name), and then File -> Delete. Then reopen the file and it should be the new version. Thanks for the reminder that we need to make this simpler. You should never have to stop and restart COSMOS. And definitely not cleanup because that deletes everything. To answer your last question, yes scripts can be run from the command line, but running scripts outside of ScriptRunner they will just stop with an exception if anything goes wrong, rather than the ScriptRunner behavior of pausing. See: https://github.com/BallAerospace/COSMOS/blob/master/examples/external_script.rb |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestions, this all is helpful to know. Our end goal is for scripts to run in script runner, but testing them initially in command line can help find some errors quicker, particularly for SW developers. And VS Code is helpful so I can edit the files directly within our git repository. I will try to get with the example script working and go from there. For some team members, I am planning for them to fully edit and run scripts in the script runner for testing. Is there a best way to get all the modified scripts out of COSMOS so I can commit them back into a git repo? We want to keep these scripts version controlled. Thank you again! :) |
Beta Was this translation helpful? Give feedback.
-
I have found that MinIO can be used to help with removing modified scripts, and can be used to download modified scripts. If you want to upload a plugin to cosmos and replace all scripts, you can log in to your MinIO instance and then delete the targets_modified folder to delete any scripts that had been modified. Additionally, this folder can be downloaded if you want to grab the modified files and put them in a repo. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I intend to use the COSMOS 5 script runner feature for system testing, but I am finding long cycle times between making script updates and actually testing them, making development/debugging slow. I am curious if there are any steps in my process that could be simplified or even done using command line to help speed up development.
Here is the current process from making a script update to actually testing it:
./cosmos-control.sh stop
./cosmos-control.sh cleanup
./cosmos-control.sh start
And a couple key questions:
Thank you for any help!
Beta Was this translation helpful? Give feedback.
All reactions