When LifeTime deploys the applications on a single stage, it does the following:
- Compiles applications code and deploys them;
- Generates SQL scripts and runs them to update the database;
- Changes the running version of applications in the application server.
In cases there is a short window of time to deploy, it may not be possible to deploy it in a single stage. It will impact business. To overcome that, LifeTime allows splitting the deployment in two stages:
The first stage is the preparation stage, with no impact:
- Applications are compiled;
- SQL scripts are generated;
- Binaries are uploaded to the destination environment, but there are no changes in the running versions.
The second stage is when changes become effective:
- SQL scripts are executed to update the database;
- The running version of applications are changed to the new ones in the application server.
Here's an example of how to do it.
Deploy MyBigWebApp in Two Stages to Avoid Impact on Business
In this example, we need to deploy the new version of MyBigWebApp to Production, but it requires some time due to its size. To avoid impact on business, the deployment window is between 2am and 3am. We have to do it in a 2-stage deployment.
Activate the 2-Stage Deployment
To activate the 2-stage deployment, login with a user with role to manage the infrastructure. Then, click on the 'Infrastructure' option and on the 'Manage Environments' link.
Click 'Edit' in the Production environment and check the 'Execute deployments in two stages' option.
Click 'Save' and the 2-stage deployment is now active for Production.
In OutSystems PaaS: the 2-stage deployment is managed in Service Center, the management console of the environment. Go to the 'Administration' tab, choose 'Environment Configuration', and check the 'Enable 2-Stage Deploy' option.
Do the First Stage of the Deployment
With the 2-stage deployment active, we can safely start deploying the application to Production with no impact on the business.
In the deployment plan, click on 'Prepare Deployment'. Applications are compiled, SQL scripts are generated, and binaries uploaded to the destination environment.
Do the Second Stage of the Deployment
As agreed, at 2am we can safely start the second stage of the deployment. Click on 'Prepared'.
In the deployment plan, click on 'Continue Deployment'. The SQL scripts are executed and running application is changed to the new version.