Anyone know the answer to this?
Detect a rollback using pre-plan scope in XLD
Is there a way to detect whether the state of a deployment is initial, upgrade, or rollback as part of a pre or post plan scoped xl-rule?
I'm specifically looking to detect rollback, but I also would like to just know in general if I can detect the type of deployment I'm in programatically?
Please sign in to leave a comment.
This shows how you can select on the
operation that is being executed.
Thanks for the response. This almost helps. The scope of the rule in the example is 'plan'. I am looking for a way to do this using either a preplan or postplan scope.
I think I misunderstood your question. If you're looking for a pre-plan scope rule, you probably don't want to check the operation for each deployable. Are you looking for something like this:
<rule name="example.destroy.wait" scope="pre-plan"> <conditions> <expression>specification.operation == "DESTROY"</expression> </conditions> <steps> <wait> <order>10</order> <seconds>10</seconds> </wait> </steps> </rule>
Here I use the
operation value of the
specification to check if it is
You can also see which objects are available at what scope at:
Let me further explain. I have a preplan scoped rule that I run as part of an initial or update deployment that inserts a deployment step to a deployment. I'd like to not detect the case when I'm in a ROLLBACK deployment, and not insert that step.
The page you sent I have been using for some time now, and I find it very helpful. However, I cannot find a way to detect if the deployment is an Initial, Upgrade, or Rollback deployment. And that is what I'm looking to do.
I think what you're referring to is something that isn't supported currently within XLD.
We already have an internal ticket for it (DEPL-7792), and I've added this this discussion also to it. I'll contact the Product Owner, to see if we can have support for this in one of the next releases. You can follow what is part of the next releases at https://docs.xebialabs.com/development-dashboard/xl-deploy-dashboard.html
Any word on if this info will be exposed in an upcoming release? I checked the dashboard, I don't see it there... just curious if it gained any traction is all.
@: We have been asking for the Rollback features for almost 2+ years now to no avail, and we are/were not the only ones asking. So far no update on any of our own tickets or communications in the community or in private.
* Having Rollback specific logic is currently impossible
* Rolling back to a previous version once a task is closed is also impossible other than using heavy scripting and using the internal api which is not documented by Xebialabs