As with most other types, cmd.Command does not deploy(execute) on an update deployment unless it has changed. You could try to add a timestamp or build ID variable to your command name.
The Advanced Command Plugin is an alternative that behaves differently in that regard. It has an alwaysRun option that allows you to run a command on all deployments.
Another alternative would be to create your own type using rules. Here is an example I made a while back.
- Add this type extension to /ext/synthetic.xml -
<type type="script2.ScriptFileDeployed" extends="udm.BaseDeployedArtifact" deployable-type="script2.Scriptfile" container-type="overthere.Host" description="Artifact that can be deployed to an example server">
<generate-deployable type="script2.Scriptfile" extends="udm.BaseDeployableFileArtifact"/>
<property name="runCommandOrNot" kind="boolean" default="True"/>
- Add this rule to /ext/rules.xml -
<rule name="script2.ScriptFileDeployed.CREATE_MODIFY" scope="deployed">
<description expression="true">"Running Script" + str(deployed.runCommandOrNot)</description>
- Create xld_home/ext/script2/deploy-artifact.cmd.ftl and add this line to it -