projectkudu / kudusync.net Goto Github PK
View Code? Open in Web Editor NEWA file copying tool with semantic appropriate for deploying web site files. Comes as a .NET exe
License: Apache License 2.0
A file copying tool with semantic appropriate for deploying web site files. Comes as a .NET exe
License: Apache License 2.0
Hi,
It seems like there is issue in https://github.com/projectkudu/KuduSync.NET/blob/master/KuduSync.NET/FileSystemHelpers.cs#L74
public static bool IsSubDirectory(string path1, string path2)
{
if (path1 != null && path2 != null)
{
path1 = Path.GetFullPath(path1);
path2 = Path.GetFullPath(path2);
return path2.StartsWith(path1, StringComparison.OrdinalIgnoreCase);
}
return false;
}
I had following hierarchy structure
Source: E:\Development\Production-WS\SequelMedFax\build\_PublishedWebsites\SequelMedFax
Target: E:\Development\Production-WS\SequelMedFax\build\_PublishedWebsites\SequelMedFax_Latest
And it was giving up error
Source and destination directories cannot be sub-directories of each other
https://github.com/projectkudu/KuduSync.NET/blob/5ff87c07d69ed7ce250267d4657c262c89dd547b/KuduSync.NET/KuduSync.cs#L56
Thanks
app_offline.htm
gets created during a kudusync copy and some times, it may fail to remove. We need to discuss and see if there's a better approach.
cc: @suwatch
In KuduSync.NET we have a feature where we can limit the number of log lines we print, if we have a large (many files) repo we want to sync we still want to see some kind of output every some time to see something is still happening.
Hi folks, I had an interesting issue where a file transitioned to a directory (a trade-off of some underlaying tooling) which failed a web deploy.
I'm not sure if this is something you'd consider supporting - but I thought it was at least worth bringing up as it felt like something like I would have expected to work.
Error: The target file "D:\home\site\wwwroot\docs\handbook\writing-declaration-files.html" is a directory, not a file.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'docs\handbook\writing-declaration-files.html'
Failed exitCode=1, command="kudusync" -v 50 -f "D:\home\site\repository" -t "D:\home\site\wwwroot" -n "D:\home\site\deployments\d05a2ce67eeb43eb7b1efb61d5add7bca7afa673\manifest" -p "D:\home\site\deployments\871b18365dbe5f2e572dbb5043fdf3de61c3af69\manifest" -i ".git;.hg;.deployment;deploy.cmd"
An error has occurred during web site deployment.
Error: The target file "D:\home\site\wwwroot\docs\handbook\writing-declaration-files.html" is a directory, not a file.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\85.11226.4297\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
We've been using this as part of Kudu for a while now and are seeing some pretty random results.
λ git push origin master
Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 569 bytes | 0 bytes/s, done.
Total 6 (delta 4), reused 0 (delta 0)
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id '3da1f2f573'.
remote: Generating deployment script.
remote: Running deployment command...
remote: Handling Basic Web Site deployment.
remote: KuduSync.NET from: 'C:\inetpub\temp\DWASFiles\Sites\34bac22d-7511-4fd8-bd31-4b2946142e94\VirtualDirectory0\site\repos
itory' to: 'C:\inetpub\temp\DWASFiles\Sites\34bac22d-7511-4fd8-bd31-4b2946142e94\VirtualDirectory0\site\wwwroot'
remote: Copying file: 'Web.config'
remote: Copying file: 'css\rtebase.css'
remote: Copying file: 'data\Revision\documenttypes\GlobalSettings.courier'
remote: Copying file: 'images\[email protected]'
remote: Copying file: 'images\bg\bg_button-middle.png'
The only file that I had touched and committed to git in this case was data\Revision\documenttypes\GlobalSettings.courier
.
Checked the KuduSync.NET solution to see how it does the file compare, it's here:
https://github.com/projectkudu/KuduSync.NET/blob/master/KuduSync.NET/KuduSync.cs#L177
However, comparing the LastWriteTimeUtc between repository and wwwroot shows the exact same date/time. These files still got copied again on the next deploy though.
I also checked the attributes on these files and they only have the Archive attribute set, so no difference there. I even downloaded both files and compared their hashes, which are exactly the same.
In these cases the files were added to the deployments\GUID\manifest
file correctly, so it presumably doesn't detect them as new files needing to be copied over.
Then I added a new .txt file in the root and suddenly 3300+ files get copied from repository > wwwroot (that's basically all the files).
Then I added another new .txt file in the root and only that file + web.config gets copied.
Have you seen similar issues? Most of all, we want to prevent those cases where 3300+ files are getting copied as it could take a long time and it's completely unnecessary.
Let me know if you need any more information or if I can test more scenario's to help debug.
Program.cs -> line 26
else
{
Console.Error.WriteLine(kuduSyncOptions.GetUsage());
return 1;
}
Hi,
I just wanted to know if this project alive?
Thanks
Clean up KuduSync.net log output to minimize redundant root path display
[Maggie]:
The only place I can see what files get deployed is in the 'Running deployment command ...' log. It's hard to fish out the list of files from the log.
The screenshot will shows what I have described. We should have a list similar to the git log (also showed in the screenshot)
for.e.g.
Command: deploy.cmd
Handling Basic Web Site deployment.
KuduSync.NET from: C:\DWASFiles\Sites\faizgithubtest\VirtualDirectory0\site\repository to: C:\DWASFiles\Sites\faizgithubtest\VirtualDirectory0\site\wwwroot
Copying file from: C:\DWASFiles\Sites\faizgithubtest\VirtualDirectory0\site\repository\About.cshtml to: C:\DWASFiles\Sites\faizgithubtest\VirtualDirectory0\site\wwwroot\About.cshtml
Copying file from: C:\DWASFiles\Sites\faizgithubtest\VirtualDirectory0\site\repository\Default.cshtml to: C:\DWASFiles\Sites\faizgithubtest\VirtualDirectory0\site\wwwroot\Default.cshtml
Could be
Command: deploy.cmd
Handling Basic Web Site deployment.
KuduSync.NET from: C:\DWASFiles\Sites\faizgithubtest\VirtualDirectory0\site\repository to: C:\DWASFiles\Sites\faizgithubtest\VirtualDirectory0\site\wwwroot
Copied : 'About.cshtml'
Copied : 'views\Default.cshtml'
Would it be possible to ship KuduSync.Net as a .Net Global Tool?
I am currently refactoring part of the my build process to prefer .Net Global Tools when building with .Net Core:
And one of the tools that I would like to include in this work is KuduSync.Net which I use when publishing documentation associated with the project that is getting built.
In the current KuduSync, when doing the SmartCopy, we are doing comparisons between the files in the source and the destination. For most files its "just" a LastWriteTimeUtc
comparison, but for web.config its an actual content comparison, but doing a SHA1 of the content in both source and destination.
I'm guessing the reason for this is that in come cases the web.config will be transformed in the webroot or just changed forth/back, or updated for some other reason, and therefore the LastWriteTimeUtc
will be different, but the file it self wont. Then in order to prevent a app restart, it does content comparison on the web.config.
We now have a case where we are using KuduSync.exe to copy files that could have been transformed, and not only the web.config, but in theory all .config files in a solution. This means that when we are KuduSync'ing between source and destination, the source's LastWriteTimeUtc
will be different than the destination, and therefore the file will be copied, even though the content are the same. As these config files are sometimes added as configSource in web.config, the copy of the file into webroot, will cause an app restart.
It would be great to add it as an option to do content comparison for all config files. The logic it self should be the same as is used in https://github.com/projectkudu/KuduSync.NET/blob/master/KuduSync.NET/KuduSync.cs#L197, just applied to config files, in stead of just the web.config.
Would this project accept a PR, with the above functionality? We would love to implements it, as it would prevent us from relying on custom builds/forks, and we think it would be something all could benefit from.
Also a bit of clarification on where this is used. We are using Azure Pack, which comes with Kudu installed to handle website deployments, so this is not run on "real" Azure. We are currently running the S48 release of Kudu on the installation.
I know I can ignore files by listing them in the -i
flag such as -i ".git;.hg;.deployment;deploy.cmd"
but this list easily gets very long. I would like to have a file similar to .gitignore
or .npmignore
where I can list files, globs, and other content to ignore, and pass this to kudusync.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.