-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix locating kudusync.cmd in Fake.Azure.Kudu #1995
Conversation
Can you please merge release/next to get the CI green? |
src/app/Fake.Azure.Kudu/Kudu.fs
Outdated
@@ -17,7 +17,7 @@ let nextManifestPath = Environment.environVarOrDefault "NEXT_MANIFEST_PATH" Stri | |||
/// Used by KuduSync for tracking and diffing deployments. | |||
let previousManifestPath = Environment.environVarOrDefault "PREVIOUS_MANIFEST_PATH" String.Empty | |||
/// The path to the KuduSync application. | |||
let kuduPath = (Environment.environVarOrDefault "GO_WEB_CONFIG_TEMPLATE" ".") |> DirectoryInfo.ofPath | |||
let kuduPath = (Environment.environVarOrDefault "GO_WEB_CONFIG_TEMPLATE" ".") |> Path.GetDirectoryName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is incorrect if we fallback to the default of .
, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same script as above in the PR with "."
Starting target 'Old'
NoDescription
"D:\home\kudusync.cmd"
Finished (Success) 'Old' in 00:00:00.1062350
Starting target 'New'
NoDescription
"kudusync.cmd"
Finished (Success) 'New' in 00:00:00.0003611
There is no kudusync.cmd in D:\home, but there is an kudusync.cmd in the PATH variable 🤔 Old fallback doesn't make to much sense to me, but I can fix it to return the same (since some people may be dependent on it, and I don't wanna break it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
src/app/Fake.Azure.Kudu/Kudu.fs
Outdated
FileName = Path.Combine(kuduPath.FullName, "kudusync.cmd") | ||
Arguments = sprintf """-v 50 -f "%s" -t "%s" -n "%s" -p "%s" -i ".git;.hg;.deployment;deploy.cmd""" deploymentTemp deploymentTarget nextManifestPath previousManifestPath }) | ||
FileName = Path.Combine(kuduPath, "kudusync.cmd") | ||
Arguments = sprintf """-v 50 -f "%s" -t "%s" -n "%s" -p "%s" -i ".git;.hg;.deployment;deploy.cmd" """ deploymentTemp deploymentTarget nextManifestPath previousManifestPath }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way would be to build an array and use Args.toWindowsCommandLine
to properly handle all the escaping ugliness of windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Works great:
2018-06-14T12:48:17.8474026Z : D:\Program Files (x86)\SiteExtensions\Kudu\74.10611.3437\bin\Scripts\kudusync.cmd "-v" "50" "-f" "D:\local\Temp\8d5d1f4f73e61d1" "-t" "D:\home\site\wwwroot" "-n" "D:\home\site\deployments\1ad4a3db64f24589945de5ab0db7cd6a\manifest" "-p" "D:\home\site\deployments\f54a08fb6cce467cb1e8427e9c6a6337\manifest" "-i" ".git;.hg;.deployment;deploy.cmd"
Thanks for taking care of this! |
Seems to me the current implementation resolves the wrong path. The following script and output is from inside the Kudu-sandbox: