XL Deploy Plugin Command not executing on upgrade

723 views Asked by At

I'm new to XL Deploy. We have defined an XL Deploy command in our pom to execute once an application is upgraded. This works the first time the application is installed, but doesn't run on subsequent upgrades. To force it to run we have to undeploy the app via XLD and then redeploy it, then the command does execute.

<cmd.Command name="appname-{{env}}-Restart-App">
    <tags>
        <value>node02</value>
        <value>node01</value>
    </tags>
    <commandLine>sudo /usr/bin/systemctl restart app-service-name</commandLine>
    <order>90</order>

    <undoCommandLine>ls -al</undoCommandLine>
    <undoOrder>49</undoOrder>
    <undoCommand ref="appname-{{env}}-Restart-App" />
    <runUndoCommandOnUpgrade>true</runUndoCommandOnUpgrade>
</cmd.Command>

I expect the command to run every time the app is upgraded, but it doesn't. Why not?

Using Maven 3, xldeploy-maven-plugin 5.1.0

1

There are 1 answers

0
Joris De Winne On

This is not possible using the command-plugin. You can use the xld-advanced-command-plugin which has an option for alwaysRun. Even better would be to specify this in a separate plugin and use a rule to define what needs to be executed. This will move away the scripting part of the command plugin into a model based approach that is much more scalable.