Merge branch 'rel/2.0.0-preview2' into dev-gate
This commit is contained in:
commit
21be9922c2
|
|
@ -56,11 +56,6 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
+ $" --framework {DeploymentParameters.TargetFramework}"
|
+ $" --framework {DeploymentParameters.TargetFramework}"
|
||||||
+ $" --configuration {DeploymentParameters.Configuration}";
|
+ $" --configuration {DeploymentParameters.Configuration}";
|
||||||
|
|
||||||
// Workaround for:
|
|
||||||
// Publish fails on app with project reference to netstandard2.0 class library
|
|
||||||
// https://github.com/dotnet/cli/issues/6843
|
|
||||||
parameters += " --no-restore";
|
|
||||||
|
|
||||||
if (DeploymentParameters.ApplicationType == ApplicationType.Standalone)
|
if (DeploymentParameters.ApplicationType == ApplicationType.Standalone)
|
||||||
{
|
{
|
||||||
parameters += $" --runtime {GetRuntimeIdentifier()}";
|
parameters += $" --runtime {GetRuntimeIdentifier()}";
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,6 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
if (DeploymentParameters.PublishApplicationBeforeDeployment)
|
if (DeploymentParameters.PublishApplicationBeforeDeployment)
|
||||||
{
|
{
|
||||||
DotnetPublish();
|
DotnetPublish();
|
||||||
|
|
||||||
// Temporary workaround for https://github.com/dotnet/cli/issues/6286
|
|
||||||
ProvideExecutePermission();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var hintUrl = TestUriHelper.BuildTestUri(DeploymentParameters.ApplicationBaseUriHint);
|
var hintUrl = TestUriHelper.BuildTestUri(DeploymentParameters.ApplicationBaseUriHint);
|
||||||
|
|
@ -96,14 +93,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
var targetFramework = DeploymentParameters.TargetFramework ?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0");
|
var targetFramework = DeploymentParameters.TargetFramework ?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0");
|
||||||
|
|
||||||
executableName = DotnetCommandName;
|
executableName = DotnetCommandName;
|
||||||
executableArgs = $"run --framework {targetFramework}";
|
executableArgs = $"run --framework {targetFramework} {DotnetArgumentSeparator}";
|
||||||
|
|
||||||
// Workaround for:
|
|
||||||
// Publish fails on app with project reference to netstandard2.0 class library
|
|
||||||
// https://github.com/dotnet/cli/issues/6843
|
|
||||||
executableArgs += " --no-restore";
|
|
||||||
|
|
||||||
executableArgs += $" {DotnetArgumentSeparator}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
executableArgs += $" --server.urls {hintUrl} "
|
executableArgs += $" --server.urls {hintUrl} "
|
||||||
|
|
@ -199,62 +189,5 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
StopTimer();
|
StopTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary workaround for https://github.com/dotnet/cli/issues/6286
|
|
||||||
private void ProvideExecutePermission()
|
|
||||||
{
|
|
||||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|
|
||||||
&& DeploymentParameters.RuntimeFlavor == RuntimeFlavor.CoreClr
|
|
||||||
&& DeploymentParameters.ApplicationType == ApplicationType.Standalone)
|
|
||||||
{
|
|
||||||
var executablePath = Path.Combine(
|
|
||||||
DeploymentParameters.PublishedApplicationRootPath,
|
|
||||||
DeploymentParameters.ApplicationName);
|
|
||||||
|
|
||||||
var chmodProcessStartInfo = new ProcessStartInfo
|
|
||||||
{
|
|
||||||
FileName = "chmod",
|
|
||||||
Arguments = $"755 {executablePath}",
|
|
||||||
UseShellExecute = false,
|
|
||||||
CreateNoWindow = true,
|
|
||||||
RedirectStandardOutput = true,
|
|
||||||
RedirectStandardError = true
|
|
||||||
};
|
|
||||||
|
|
||||||
var chmodProcess = new Process() { StartInfo = chmodProcessStartInfo };
|
|
||||||
try
|
|
||||||
{
|
|
||||||
chmodProcess.StartAndCaptureOutAndErrToLogger("chmod", Logger);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.LogError(
|
|
||||||
"Error occurred while starting the process '{processName}'. Exception: {exception}",
|
|
||||||
chmodProcessStartInfo.FileName,
|
|
||||||
ex.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
var hasExited = chmodProcess.WaitForExit(3 * 1000);
|
|
||||||
|
|
||||||
if (hasExited)
|
|
||||||
{
|
|
||||||
if (chmodProcess.ExitCode != 0)
|
|
||||||
{
|
|
||||||
Logger.LogError(
|
|
||||||
"Process {processName} with id {pid} exited with code {exitCode} or failed to start.",
|
|
||||||
chmodProcessStartInfo.FileName,
|
|
||||||
HostProcess.Id,
|
|
||||||
HostProcess.ExitCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.LogError(
|
|
||||||
"Process {processName} with id {pid} did not exit in the given amount of time.",
|
|
||||||
chmodProcessStartInfo.FileName,
|
|
||||||
HostProcess.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue