Hello,
I have a requirement to upload the contents of a NuGet package to an Azure blob container, where each blob should be prefixed with either rc\
or the the release number.
- If the release number contains ‘rc’, all blobs should be pre-fixed with
rc/
- Otherwise, all blobs should be pre-fixed with the release number, e.g.
1.2.3/
The uploading of the blobs is fine, and I can define the prefix using a variable, but I’m finding issues when trying to use #{if}
and #{else}
to set the prefix variable. As you can see, I’m attempting to use Conditionals with Complex Syntax in conjunction with the Replace filter
#{if Octopus.Release.Number | Replace "[^a-z]" == "rc"}rc\{#else}#{Octopus.Release.Number}\#{/if}
However, using the above as a variable value results in that value being the blob prefix, meaning all my blobs are prefixed -
- #{if Octopus.Release.Number | Replace “[^a-z]” == “rc”}rc
- {#else}#{Octopus.Release.Number}
- #{/if}
I was wondering if the Extended Syntax wasn’t available to use in variable values, but the docs state -
It’s worth noting that this is now available everywhere whereas previously it was limited to certain scenarios.
Is there something wrong with my declaration, or is the documentation leading me astray?
Thanks,
David