Rename "dnu bundle" to "dnu publish"

This commit is contained in:
Wei Wang 2015-03-28 12:10:12 -07:00
parent e23365f757
commit 1e29b52278
5 changed files with 28 additions and 28 deletions

View File

@ -6,7 +6,7 @@
"node_modules", "node_modules",
"grunt" "grunt"
], ],
"bundleExclude": [ "publishExclude": [
"bower.json", "bower.json",
"package.json", "package.json",
"gruntfile.js", "gruntfile.js",

View File

@ -9,7 +9,7 @@
"**/*.cs", "**/*.cs",
"../../test/E2ETests/compiler/shared/**/*.cs" // This code is for testing only. "../../test/E2ETests/compiler/shared/**/*.cs" // This code is for testing only.
], ],
"bundleExclude": "*.cmd", "publishExclude": "*.cmd",
"webroot": "wwwroot", "webroot": "wwwroot",
"dependencies": { "dependencies": {
"EntityFramework.SqlServer": "7.0.0-*", "EntityFramework.SqlServer": "7.0.0-*",

View File

@ -33,8 +33,8 @@ namespace E2ETests
} }
else else
{ {
// Cannot override with environment in case of IIS. Bundle and write a Microsoft.AspNet.Hosting.ini file. // Cannot override with environment in case of IIS. Publish and write a Microsoft.AspNet.Hosting.ini file.
startParameters.BundleApplicationBeforeStart = true; startParameters.PublishApplicationBeforeStart = true;
} }
} }
@ -50,14 +50,14 @@ namespace E2ETests
startParameters.Runtime = SwitchPathToRuntimeFlavor(startParameters.RuntimeFlavor, startParameters.RuntimeArchitecture, logger); startParameters.Runtime = SwitchPathToRuntimeFlavor(startParameters.RuntimeFlavor, startParameters.RuntimeArchitecture, logger);
//Reason to do pack here instead of in a common place is use the right runtime to do the packing. Previous line switches to use the right runtime. //Reason to do pack here instead of in a common place is use the right runtime to do the packing. Previous line switches to use the right runtime.
if (startParameters.BundleApplicationBeforeStart) if (startParameters.PublishApplicationBeforeStart)
{ {
#if DNX451 #if DNX451
if (startParameters.ServerType == ServerType.IISNativeModule || if (startParameters.ServerType == ServerType.IISNativeModule ||
startParameters.ServerType == ServerType.IIS) startParameters.ServerType == ServerType.IIS)
{ {
// Bundle to IIS root\application folder. // Publish to IIS root\application folder.
DnuBundle(startParameters, logger, Path.Combine(Environment.GetEnvironmentVariable("SystemDrive") + @"\", @"inetpub\wwwroot")); DnuPublish(startParameters, logger, Path.Combine(Environment.GetEnvironmentVariable("SystemDrive") + @"\", @"inetpub\wwwroot"));
// Drop a Microsoft.AspNet.Hosting.ini with ASPNET_ENV information. // Drop a Microsoft.AspNet.Hosting.ini with ASPNET_ENV information.
logger.LogInformation("Creating Microsoft.AspNet.Hosting.ini file with ASPNET_ENV."); logger.LogInformation("Creating Microsoft.AspNet.Hosting.ini file with ASPNET_ENV.");
@ -96,7 +96,7 @@ namespace E2ETests
else else
#endif #endif
{ {
DnuBundle(startParameters, logger); DnuPublish(startParameters, logger);
} }
} }
@ -136,11 +136,11 @@ namespace E2ETests
throw new Exception("Runtime not detected on the machine."); throw new Exception("Runtime not detected on the machine.");
} }
if (startParameters.BundleApplicationBeforeStart) if (startParameters.PublishApplicationBeforeStart)
{ {
// We use full path to runtime to pack. // We use full path to runtime to pack.
startParameters.Runtime = new DirectoryInfo(runtimeBin).Parent.FullName; startParameters.Runtime = new DirectoryInfo(runtimeBin).Parent.FullName;
DnuBundle(startParameters, logger); DnuPublish(startParameters, logger);
} }
//Mono now supports --appbase //Mono now supports --appbase
@ -180,7 +180,7 @@ namespace E2ETests
startParameters.ApplicationHostConfigTemplateContent.Replace("[ApplicationPhysicalPath]", Path.Combine(startParameters.ApplicationPath, "wwwroot")); startParameters.ApplicationHostConfigTemplateContent.Replace("[ApplicationPhysicalPath]", Path.Combine(startParameters.ApplicationPath, "wwwroot"));
} }
if (!startParameters.BundleApplicationBeforeStart) if (!startParameters.PublishApplicationBeforeStart)
{ {
IISExpressHelper.CopyAspNetLoader(startParameters.ApplicationPath); IISExpressHelper.CopyAspNetLoader(startParameters.ApplicationPath);
} }
@ -291,17 +291,17 @@ namespace E2ETests
return runtimeName; return runtimeName;
} }
private static void DnuBundle(StartParameters startParameters, ILogger logger, string bundleRoot = null) private static void DnuPublish(StartParameters startParameters, ILogger logger, string publishRoot = null)
{ {
startParameters.BundledApplicationRootPath = Path.Combine(bundleRoot ?? Path.GetTempPath(), Guid.NewGuid().ToString()); startParameters.PublishedApplicationRootPath = Path.Combine(publishRoot ?? Path.GetTempPath(), Guid.NewGuid().ToString());
var parameters = var parameters =
string.Format( string.Format(
"bundle {0} -o {1} --runtime {2} {3}", "publish {0} -o {1} --runtime {2} {3}",
startParameters.ApplicationPath, startParameters.ApplicationPath,
startParameters.BundledApplicationRootPath, startParameters.PublishedApplicationRootPath,
startParameters.Runtime, startParameters.Runtime,
startParameters.BundleWithNoSource ? "--no-source" : string.Empty); startParameters.PublishWithNoSource ? "--no-source" : string.Empty);
logger.LogInformation("Executing command dnu {args}", parameters); logger.LogInformation("Executing command dnu {args}", parameters);
@ -320,10 +320,10 @@ namespace E2ETests
(startParameters.ServerType == ServerType.IISExpress || (startParameters.ServerType == ServerType.IISExpress ||
startParameters.ServerType == ServerType.IISNativeModule || startParameters.ServerType == ServerType.IISNativeModule ||
startParameters.ServerType == ServerType.IIS) ? startParameters.ServerType == ServerType.IIS) ?
Path.Combine(startParameters.BundledApplicationRootPath, "wwwroot") : Path.Combine(startParameters.PublishedApplicationRootPath, "wwwroot") :
Path.Combine(startParameters.BundledApplicationRootPath, "approot", "src", "MusicStore"); Path.Combine(startParameters.PublishedApplicationRootPath, "approot", "src", "MusicStore");
logger.LogInformation("dnu bundle finished with exit code : {exitCode}", hostProcess.ExitCode); logger.LogInformation("dnu publish finished with exit code : {exitCode}", hostProcess.ExitCode);
} }
public static void CleanUpApplication(StartParameters startParameters, Process hostProcess, string musicStoreDbName, ILogger logger) public static void CleanUpApplication(StartParameters startParameters, Process hostProcess, string musicStoreDbName, ILogger logger)
@ -381,12 +381,12 @@ namespace E2ETests
} }
} }
if (startParameters.BundleApplicationBeforeStart) if (startParameters.PublishApplicationBeforeStart)
{ {
try try
{ {
//We've originally bundled the application in a temp folder. We need to delete it. //We've originally published the application in a temp folder. We need to delete it.
Directory.Delete(startParameters.BundledApplicationRootPath, true); Directory.Delete(startParameters.PublishedApplicationRootPath, true);
} }
catch (Exception exception) catch (Exception exception)
{ {

View File

@ -21,11 +21,11 @@
public string ApplicationPath { get; set; } public string ApplicationPath { get; set; }
public bool BundleApplicationBeforeStart { get; set; } public bool PublishApplicationBeforeStart { get; set; }
public string BundledApplicationRootPath { get; set; } public string PublishedApplicationRootPath { get; set; }
public bool BundleWithNoSource { get; set; } public bool PublishWithNoSource { get; set; }
public string Runtime { get; set; } public string Runtime { get; set; }

View File

@ -50,8 +50,8 @@ namespace E2ETests
ServerType = serverType, ServerType = serverType,
RuntimeFlavor = runtimeFlavor, RuntimeFlavor = runtimeFlavor,
RuntimeArchitecture = architecture, RuntimeArchitecture = architecture,
BundleApplicationBeforeStart = true, PublishApplicationBeforeStart = true,
BundleWithNoSource = noSource PublishWithNoSource = noSource
}; };
var stopwatch = Stopwatch.StartNew(); var stopwatch = Stopwatch.StartNew();
@ -94,7 +94,7 @@ namespace E2ETests
{ {
if (Directory.GetFiles(_startParameters.ApplicationPath, "*.cmd", SearchOption.TopDirectoryOnly).Length > 0) if (Directory.GetFiles(_startParameters.ApplicationPath, "*.cmd", SearchOption.TopDirectoryOnly).Length > 0)
{ {
throw new Exception("bundleExclude parameter values are not honored."); throw new Exception("publishExclude parameter values are not honored.");
} }
} }