Post

1 follower Follow
0
Avatar

How to use destroyOptions with deployeds from the generic plugin?

Hi,

I am trying to use the new destroyOptions introduced in 3.9 as I would like to suppress uploading of my artifact. However this doesn't seem to work.

I added to my deployed:

<property name="destroyOptions" kind="set\_of\_string" default="none" hidden="true" />

What am I doing wrong?

Richard

rswart

Please sign in to leave a comment.

8 comments

0
Avatar

Hi Richard

On which type are you setting this option?

Regards

Andrew

XebiaLabs

XebiaLabs Support 0 votes
0
Avatar

on a custom type that extends generic.ExecutedScriptWithDerivedArtifact

Are you referencing deployed.file somewhere in your destroyScript? This is taken as an explicit "upload me" instruction which would cause the file to be uploaded as soon as the expression in encountered.

Regards

Andrew

XebiaLabs

XebiaLabs Support 0 votes
0
Avatar

I am referencing deployed.deployable.file to get the filename I need to delete.

 

 

rswart 0 votes
0
Avatar

I did a quick test and it seems that referencing the file does indeed trigger the upload.

 Question now remains on how I can get a hold of the filename of the deployed without triggering the upload. Currently I am doing this in my destroy script:

APPLICATIONFILE=$(basename "${deployed.deployable.file}")

Any suggestions for getting the same info without triggering the upload?

 

 

 

rswart 0 votes
0
Avatar

Hi Richard

Any suggestions for getting the same info without triggering the upload?

Would deployed.name or <ttdeployed.deployable.name work? Otherwise, we could add a targetFile property much like appears on CopiedArtifact and use that?

Regards

Andrew

XebiaLabs

XebiaLabs Support 0 votes
0
Avatar

Thank you for your suggestions.

 

deployed.name or deployed.deployable.name doesn't do the trick because that is not really the same as the file/archive name but an alias.. We currently have a version in the filename but not in the CI-name.

 

As workaround I have added a fileName property to the deployed and set this property in a contributor. 

 

Thanks

Richard

 

 

 

 

rswart 0 votes
0
Avatar

As workaround I have added a fileName property to the deployed and set this property in a contributor.

Nice solution!

Would it also be possible to simply set this fileName property during packaging? I assume it's already known at that time..?

Regards

Andrew

XebiaLabs

XebiaLabs Support 0 votes