How to script pre, and post tasks
Tasks that need to be run BEFORE the application is started, should be started using the Cloudhouse.Container.Run.exe, with an entry in Programs.xml.
Tasks that need to be executed AFTER the application has been started, should be started after the application using the Cloudhouse.Container.Run.exe tool, with an entry in Programs.xml.
Commands that need to run AFTER the application has exited, should be specified with <Events>, <Exit> tags.
Any number of PowerShell or Java scripts, executables, batch files etc can be run using these tags.
<Events> <Start>Usage.exe /start</Start> <Exit>Usage.exe /end</Exit> <Exit>PowerShell .\custom-script.ps1</Exit> </Events>
All scripts, and exectuables are executed asynchronously, a process is spawned to perform the task, and execution proceeds immediately to the next exit tag.