Incremental deployment on changed resources
Hi,
is there a way to do an "update" deploy? If I have 100 resources but only 4 modified by the commit I would deploy only the 4 modified.
Is there a way to do this easily with the Include/Exclude Filtering Text?
Thanks Fabio
There is no feature like this out of the box. You can do that using filtering capability as soon as you figure out how to determine a list of modified objects - which is not easy. I will consider adding such a feature to the module (saving somewhere last deployment state), but I don't have any ETA for now.
This is how I did to filter unchanged objects, it is not perfect, if a pipeline fails, you have to run a full deploy:
# Get changes to deploy
$filterFilePath = (Join-Path -Path $fullRootPath -ChildPath '\filterFile.txt')
"-pipeline.*`r`n-trigger.*`r`n-dataset.*`r`n-dataflow.*`r`n-template.*" | out-file -filepath $filterFilePath -append -width 2000 -Encoding Ascii
$diff = git diff -M --name-only HEAD HEAD~1
$files = $diff.Split(" ")
ForEach ($file in $files){
if ($file -like "src/dataplatform/data-factory/*"){
$file = $file.replace("src/dataplatform/data-factory/", "")
$file = $file.replace(".json", "")
$file = $file.replace("/", ".")
"+" + $file | out-file -filepath $filterFilePath -append -width 2000 -Encoding Ascii
}
}
if ($_FullDeploy){
$opt = New-AdfPublishOption -FilterFilePath $filterFilePath
}
else{
$opt = New-AdfPublishOption
}
Available in ver.1.4 (preview) https://www.powershellgallery.com/packages/azure.datafactory.tools/1.4.0-preview See documentation: https://github.com/Azure-Player/azure.datafactory.tools/tree/ver.1.4