Create a package to call all existing packages
In this sample, we iterate over all of the DTSX files in a given directory (and all subdirectories). We then create an ExecutePackage task to execute each of them. Note that if you don't want to do a recursive directory search, you can instead use System.IO.SearchOption.TopDirectoryOnly in the GetFiles method call.
In case your team has differing file system layouts, we have also provided a check for the "PROJECT_ROOT" environment variable. If present, it uses the value of the environment variable as the search folder. If not present, it falls back to a default hard-coded folder. Remember that if you are setting the environment variable for the first time, you may need to restart BimlExpress or BimlStudio to ensure that the variable is being picked up.
<# var projectRootEnvVar = System.Environment.GetEnvironmentVariable("PROJECT_ROOT"); #>
<# var sourceDirectory = string.IsNullOrEmpty(projectRootEnvVar) ? @"C:\Path\Where\Packages\Live" : projectRootEnvVar;#>
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="Execute All Non-Biml Packages" ConstraintMode="Parallel">
<Tasks>
<# foreach (var filePath in System.IO.Directory.GetFiles(sourceDirectory, "*.dtsx", System.IO.SearchOption.AllDirectories)) { #>
<ExecutePackage Name="Run <#=filePath#>">
<ExternalFile ExternalFilePath="<#=filePath#>" />
</ExecutePackage>
<# } #>
</Tasks>
</Package>
</Packages>
</Biml>