Post

3 followers Follow
1
Avatar

Detect a rollback using pre-plan scope in XLD

Hello,

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?

Thanks,

Josh

Josh Figler

Please sign in to leave a comment.

9 comments

0
Avatar

Hi Joris,

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.

Thanks,

Josh

Josh Figler 0 votes
0
Avatar

Hi Josh,

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 DESTROY.
You can also see which objects are available at what scope at:
https://docs.xebialabs.com/xl-deploy/concept/objects-and-properties-available-to-rules.html

Regards,
Joris

Joris De Winne 0 votes
0
Avatar

Hi Joris,

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.

Thanks,

Josh

Josh Figler 0 votes
1
Avatar

Hi Josh,

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

Regards,
Joris

Joris De Winne 1 vote
0
Avatar

Thanks Joris.

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.

Thanks,

Josh

Josh Figler 0 votes
0
Avatar

@Josh Figler: 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

@Xebia #pleaseCorrectMeIfImWrong

Andrew Boswell 0 votes