20
Views
4
Comments
Automate a task upon deployment
Question

Is there a way to run an automated task after deployment? For example, I want to run a database script each time a deployment is done using LifeTime on the destination environment.

Rank: #1593

hi Khalil,


You can do it using Timers. You will need to create actions to execute your database script. You can schedule it to run at particular time after deployment is done.

You can refer this link for more information : https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Timershttps://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/OutSystems_Platform_Timers_and_Asynchronous_Processes


Regards,

Shilpa Uppund

Rank: #388

Hi,


You can create a timer and set the Schedule to - When publish. In the timer action you write down your sql. So when ever you publish it will run at the time only.

Rank: #3711

Timers will not do since I need the script to run on any deployment and not just the deployment of a specific module.

mvp_badge
MVP
Rank: #17

Hi Khalil,

As already explained by others a timer is the way to implement this. To avoid that the timer runs on every 1CP you can use a site property that you set to true during the deploy to the next environment. 

If you want to run some code after a complete deployment, then you can only do that by running a second deployment of an application that will do the code you want to run on deploy.

Unfortunately Lifetime has no hooks available to add logic to, the way you want it.

Regards,

Daniel