Wildcard / "or" logic for Octopus variables?

Hi,

I’m wondering if it is possible to use a wildcard character in octopus variables (such as *Name.dacpac , %Name.dacpac)? How about “Or” functionality (ProjectName.Data.Name.dacpac OR Name.dacpac)? Here is the problem I am trying to solve:

Our .dacpac files are intermittently getting created with different naming conventions. They are supposed to be created like “Name.dacpac,” but Teamcity /MSbuild sometimes creates these as “ProjectName.Data.Name.dacpac” instead. We’ve spent too much time trying to figure out why/how to fix on the Teamcity side, and now would like to see if Octopus can handle this for us instead - we know it will be one of the 2 names, but would like it to be able to handle either.

Thanks!

I ended up handling this in the Powershell .dacpac deploy script instead of directly in Octopus.

Previously, we were passing in the $DACPACPackageName to Powershell as an Octopus variable. Now Powershell sets this parameter dynamically:

$strFileName = ($InstallPath + “\Name.dacpac”)
If (Test-Path $strFileName){
$DACPACPackageName = “Name.dacpac”
}Else{
$DACPACPackageName = “Project.Data.Name.dacpac”
}