Skip to content
Antonio Robirosa edited this page Feb 16, 2023 · 5 revisions

Usage

What are the advantages of the Areco Deployment Scripts manager compared to the Hybris Patch extension?

Hybris' Patch extension documentation

Advantages of Areco Deployment manager over the Patch extension

  1. The developers need to write less files to import data or make sql updates
  2. Supports Groovy and Beanshell scripts
  3. Only one configuration file is required to import data in different groups of servers
  4. Exceptions during the execution of an ImpEx file stop the further execution of the deployment scripts/patches
  5. The execution order of the deployment scripts is guaranteed because past ones can't be excluded. This don't apply to scripts which run multiple times. Use them scarcely because you have to maintance them when you change your data model
  6. Deployment Scripts can be executed without starting the Update Running System process. This accelerates the writing of deployment scripts

Advantages of the Hybris' Patch extension:

  1. Complex data imports based on a hierarcy are possible

Writing deployment scripts

I have written a deployment script for a ticket, run it locally and then I changed it. Why the extension ignores the changes?

Each deployment script is only run once. If there was an error the extension tries again until it finishes successfully. If you change the script after it run successfully, the extension won't see your changes but you can try this:

If you are sure that your script was only run on your computer:

Go to Platform Backoffice (or HMC) > System > Deployment Scripts Manager > Deployment Scripts Executions, remove the execution of the deployment script you changed and then run an update running system.

If your script was run in other computers:

You would have to create a new deployment script with a different date.

I made a mistake in the deployment script, how do I correct it?

If your deployment script didn't run successfully in any computer:#

You could change the original deployment script. The next time that you or your workmates do an update running system, the extension is going to try to run your deployment script again.

If you are sure that your script was only run successfully on your computer:

Go to Platform Backoffice (or HMC) > System > Deployment Scripts Manager > Deployment Scripts Executions, remove the execution of the deployment script you changed and then run an update running system.

If the deployment scripts has already run successfully in at least computer, which it is not yours:

The extension is going to ignore any changes you do to your deployment script. It uses the directory name as an ID and this ID is never run again. In this case you must create a new deployment script with a different date.

In my project we have another environments which aren't DEV, TEST, INT or PRODUCTION. Is there any way to remove the default ones and create new ones?

Yes, just use a deployment script with an Impex Script which removes or adds instances of DeploymentEnvironment. In the file arecoDeploymentScriptsManager/resources/initial-configuration.impex you would find an example. Please don't modify the initial configuration because this file is only imported once during the installation of the deployment manager extension. Beacuase the deployment script runner uses lazy loading for the environments you can change your environments however you need.

It is possible to run a cronjob using a deployment script?

Yes, see the example 20141006_RUN_CRONJOB_WITH_BEANSHELL in the arecoDeploymentScriptsExamples extension.

My deployment scripts depend on sample data. How can I turn off the execution of these scripts if there is no sample data?

Using sample or project data once all the impex scripts where migrated to Areco deployment scripts is not recommended. Here you will find the instructions for the migration

The creation of sample data or project data has shortcomings which the deployment managers avoids. For example, the creation can be turned off and there isn't any error handling of impex errors (you have to check the console output) which may lead to different environment with different data samples. This makes troubleshooting hard.

If you can't migrated all your current sample and project data scripts to Areco deployment scripts, please wait for the implementation of the feature #16.

Testing

What it is the best way to test the deployment scripts?

The same way you do your deployments: If you run them using ant updatesystem, you must use ant. On the other hand, if you use HAC, you must test the scripts using HAC.

Update Running System

Is there any way to run the deployment scripts without updating the system?

Yes, you could run them using Platform Backoffice, HMC or ant. Please read this page: How to run deployment scripts

How can I run the deployment scripts with an user different from admin?

You must create a groovy script which sets the current user to the required one as the first step in your deployment script's directory. After all deployment scripts are ran, the current user is set back automatically.

Deployment scripts are ran as admin if you don't include this groovy script.

Initialization

When I do an initialization, some deployment scripts don't work. Is there any way to prevent this?

The main cause of the errors are usually changes in the datamodel. One approach would be to do an initialization once a week and adapt the old deployment scripts to the new datamodel. But the value of the use of the initialization for setting up a development environment decreases with the time. After two or three years it becomes very difficult to initialize a database and to have all the last features working. A better approach is to create a anonymizing process and every three months or less create a new development database from production. If you do this, only the deployment scripts which aren't in production are going to be run in your development database.

If you wrote an init script which overwrites Hybris impex files, it will fail because init scripts are run on the core extension. Please create an update deployment script with the configuration runmultipletimes=true. See below.

How you I override changes made by Hybris' impex files in the project or essential data step?

If you are on the SAP cloud, you could create an update deployment script with the configuration runmultipletimes=true If you have a system on premises or in other cloud provider, please use ant customize to make your changes permanent. You have to create your own version of Hybris ImpEx file. Finally, you could create a java bean which imports an impex files on every project or essential data step but with this solution you will have to check the logs to see if there were errors running your impex. You don't have strict error handling.

Clone this wiki locally