diff --git a/build/testIntegration.sh b/build/testIntegration.sh index 50dfdcd0b9..dcf75f6199 100644 --- a/build/testIntegration.sh +++ b/build/testIntegration.sh @@ -11,7 +11,7 @@ source $REPO_DIR/build/__variables.sh # When this script is run in CI agent these environment variables are already set if [ -z "$SQLSERVER_DATABASE_HOST" ]; then - function getValueFromKeyVault() { + function getSecretFromKeyVault() { local secretName="$1" result=`az.cmd keyvault secret show \ --name "$secretName" \ @@ -23,11 +23,11 @@ if [ -z "$SQLSERVER_DATABASE_HOST" ]; then } echo - echo Retreiving values from keyvault... - export SQLSERVER_DATABASE_HOST=$(getValueFromKeyVault "SQLSERVER-DATABASE-HOST") - export SQLSERVER_DATABASE_NAME=$(getValueFromKeyVault "SQLSERVER-DATABASE-NAME") - export SQLSERVER_DATABASE_USERNAME=$(getValueFromKeyVault "SQLSERVER-DATABASE-USERNAME") - export SQLSERVER_DATABASE_PASSWORD=$(getValueFromKeyVault "SQLSERVER-DATABASE-PASSWORD") + echo Retrieving secrets from Azure Key Vault... + export SQLSERVER_DATABASE_HOST=$(getSecretFromKeyVault "SQLSERVER-DATABASE-HOST") + export SQLSERVER_DATABASE_NAME=$(getSecretFromKeyVault "SQLSERVER-DATABASE-NAME") + export SQLSERVER_DATABASE_USERNAME=$(getSecretFromKeyVault "SQLSERVER-DATABASE-USERNAME") + export SQLSERVER_DATABASE_PASSWORD=$(getSecretFromKeyVault "SQLSERVER-DATABASE-PASSWORD") fi echo @@ -48,8 +48,8 @@ testProjectName="Oryx.Integration" cd "$TESTS_SRC_DIR/$testProjectName.Tests" # These two images are used in Buildpacks-related integration tests -docker pull heroku/buildpacks:18 -docker pull heroku/pack:18 +docker pull "heroku/buildpacks:18" +docker pull "heroku/pack:18" dotnet test \ $testCaseFilter \ diff --git a/images/pack-builder/oryx-buildpack/bin/build b/images/pack-builder/oryx-buildpack/bin/build index c1c65de09f..9802731d31 100755 --- a/images/pack-builder/oryx-buildpack/bin/build +++ b/images/pack-builder/oryx-buildpack/bin/build @@ -20,7 +20,7 @@ firstPlatform=${firstPlatform%]} # Remove ] echo "# Running 'oryx buildpack-build .' in '`pwd`'..." oryx buildpack-build . -echo "# Running 'oryx run-script' in '`pwd`'..." +echo "# Running 'oryx run-script --platform $firstPlatform --output $runFile' in '`pwd`'..." oryx run-script --platform $firstPlatform --output $runFile chmod +x $runFile diff --git a/src/BuildScriptGeneratorCli/BuildScriptGeneratorCli.csproj b/src/BuildScriptGeneratorCli/BuildScriptGeneratorCli.csproj index 9b9ba2bf46..13aa7a82e4 100644 --- a/src/BuildScriptGeneratorCli/BuildScriptGeneratorCli.csproj +++ b/src/BuildScriptGeneratorCli/BuildScriptGeneratorCli.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/BuildScriptGeneratorCli/Commands/OptionTemplates.cs b/src/BuildScriptGeneratorCli/Commands/OptionTemplates.cs index 511d5710f1..c70ee77374 100644 --- a/src/BuildScriptGeneratorCli/Commands/OptionTemplates.cs +++ b/src/BuildScriptGeneratorCli/Commands/OptionTemplates.cs @@ -7,8 +7,8 @@ namespace Microsoft.Oryx.BuildScriptGeneratorCli { internal static class OptionTemplates { - public const string Platform = "--platform |-l|--language "; - public const string PlatformVersion = "--platform-version |--language-version "; + public const string Platform = "-l|--platform "; + public const string PlatformVersion = "--language-version "; public const string Property = "-p|--property "; } } diff --git a/src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs b/src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs index 24919345cd..2792a34e8d 100644 --- a/src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs +++ b/src/BuildScriptGeneratorCli/Commands/RunScriptCommand.cs @@ -13,27 +13,26 @@ namespace Microsoft.Oryx.BuildScriptGeneratorCli { - [Command(Name, Description = "Generate startup script.", + [Command(Name, Description = "Generate startup script for an app.", ThrowOnUnexpectedArgument = false, AllowArgumentSeparator = true)] internal class RunScriptCommand : CommandBase { public const string Name = "run-script"; [Argument(0, Description = "The application directory.")] + [DirectoryExists] public string AppDir { get; set; } = "."; [Option( OptionTemplates.Platform, CommandOptionType.SingleValue, - Description = "The name of the programming platform, e.g. 'nodejs'.", - ValueName = "Platform name")] + Description = "The name of the programming platform, e.g. 'nodejs'.")] public string PlatformName { get; set; } [Option( OptionTemplates.PlatformVersion, CommandOptionType.SingleValue, - Description = "The version of the platform to run the application on, e.g. '10' for nodejs.", - ValueName = "PlatformVersion")] + Description = "The version of the platform to run the application on, e.g. '10' for nodejs.")] public string PlatformVersion { get; set; } [Option( @@ -46,12 +45,6 @@ internal class RunScriptCommand : CommandBase internal override int Execute(IServiceProvider serviceProvider, IConsole console) { - if (string.IsNullOrWhiteSpace(PlatformName)) - { - console.WriteErrorLine("Platform name is required."); - return ProcessConstants.ExitFailure; - } - string appPath = Path.GetFullPath(AppDir); ILoggerFactory loggerFactory = serviceProvider.GetRequiredService(); var sourceRepo = new LocalSourceRepo(appPath, loggerFactory); @@ -60,7 +53,7 @@ internal override int Execute(IServiceProvider serviceProvider, IConsole console { SourceRepo = sourceRepo, PlatformVersion = PlatformVersion, - PassThruArguments = RemainingArgs + PassThruArguments = RemainingArgs, }; var runScriptGenerator = serviceProvider.GetRequiredService(); @@ -89,9 +82,9 @@ internal override int Execute(IServiceProvider serviceProvider, IConsole console internal override bool IsValidInput(IServiceProvider serviceProvider, IConsole console) { - if (!Directory.Exists(AppDir)) + if (string.IsNullOrWhiteSpace(PlatformName)) { - console.WriteErrorLine($"Could not find the directory '{AppDir}'."); + console.WriteErrorLine("Platform name is required."); return false; } diff --git a/tests/BuildScriptGeneratorCli.Tests/TestConsole.cs b/tests/BuildScriptGeneratorCli.Tests/TestConsole.cs index 0a49360d0f..73352d0f55 100644 --- a/tests/BuildScriptGeneratorCli.Tests/TestConsole.cs +++ b/tests/BuildScriptGeneratorCli.Tests/TestConsole.cs @@ -72,9 +72,9 @@ public string StdError public bool IsInputRedirected => throw new NotImplementedException(); - public bool IsOutputRedirected => throw new NotImplementedException(); + public bool IsOutputRedirected => true; - public bool IsErrorRedirected => throw new NotImplementedException(); + public bool IsErrorRedirected => true; public ConsoleColor ForegroundColor { diff --git a/tests/Oryx.BuildImage.Tests/DotNetCoreSampleAppsTest.cs b/tests/Oryx.BuildImage.Tests/DotNetCoreSampleAppsTest.cs index b6b928341b..0a6ef6500f 100644 --- a/tests/Oryx.BuildImage.Tests/DotNetCoreSampleAppsTest.cs +++ b/tests/Oryx.BuildImage.Tests/DotNetCoreSampleAppsTest.cs @@ -383,7 +383,7 @@ public void Build_ExecutesPreAndPostBuildScripts_WithinBenvContext() var appDir = volume.ContainerDir; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -l dotnet --language-version 2.1") + .AddBuildCommand($"{appDir} --platform dotnet --language-version 2.1") .ToString(); // Act @@ -445,7 +445,7 @@ public void Build_CopiesContentCreatedByPreAndPostBuildScript_ToExplicitOutputDi var appDir = volume.ContainerDir; var tempOutputDir = "/tmp/output"; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -o {tempOutputDir} -l dotnet --language-version 2.1") + .AddBuildCommand($"{appDir} -o {tempOutputDir} --platform dotnet --language-version 2.1") .AddFileExistsCheck($"{tempOutputDir}/pre-{fileName}") .AddFileExistsCheck($"{tempOutputDir}/post-{fileName}") .ToString(); @@ -507,7 +507,7 @@ public void Build_CopiesContentCreatedByPreAndPostBuildScript_ToImplicitOutputDi var appDir = volume.ContainerDir; var outputDir = $"{appDir}/{DotNetCoreConstants.OryxOutputPublishDirectory}"; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -l dotnet --language-version 2.1") + .AddBuildCommand($"{appDir} --platform dotnet --language-version 2.1") .AddFileExistsCheck($"{outputDir}/pre-{fileName}") .AddFileExistsCheck($"{outputDir}/post-{fileName}") .ToString(); @@ -547,7 +547,7 @@ public void Build_Executes_InlinePreAndPostBuildCommands() var appDir = volume.ContainerDir; var tempOutputDir = "/tmp/output"; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -o {tempOutputDir} -l dotnet --language-version 2.1") + .AddBuildCommand($"{appDir} -o {tempOutputDir} --platform dotnet --language-version 2.1") .ToString(); // Act @@ -603,7 +603,7 @@ public void Build_CopiesContentCreatedByPostBuildScript_ToExplicitOutputDirector var tempOutputDir = "/tmp/output"; var script = new ShellScriptBuilder() .AddBuildCommand( - $"{appDir} -o {tempOutputDir} -l dotnet --language-version 2.1 " + + $"{appDir} -o {tempOutputDir} --platform dotnet --language-version 2.1 " + $"-p {ScriptGenerator.Constants.ZipAllOutputBuildPropertyKey}=true") .AddFileDoesNotExistCheck($"{tempOutputDir}/post-{fileName}") .AddCommand($"cd {tempOutputDir} && tar -xvf {FilePaths.CompressedOutputFileName}") @@ -661,7 +661,7 @@ public void Build_CopiesContentCreatedByPostBuildScript_ToImplicitOutputDirector var outputDir = $"{appDir}/{DotNetCoreConstants.OryxOutputPublishDirectory}"; var script = new ShellScriptBuilder() .AddBuildCommand( - $"{appDir} -l dotnet --language-version 2.1 " + + $"{appDir} --platform dotnet --language-version 2.1 " + $"-p {ScriptGenerator.Constants.ZipAllOutputBuildPropertyKey}=true") .AddFileDoesNotExistCheck($"{outputDir}/post-{fileName}") .AddCommand($"cd {outputDir} && tar -xvf {FilePaths.CompressedOutputFileName}") @@ -698,7 +698,7 @@ public void MultiPlatformBuild_IsDisabled() var appOutputDir = $"{appDir}/myoutputdir"; var buildScript = new ShellScriptBuilder() .AddCommand("export ENABLE_MULTIPLATFORM_BUILD=true") - .AddBuildCommand($"{appDir} -o {appOutputDir} -l dotnet --language-version 2.2") + .AddBuildCommand($"{appDir} -o {appOutputDir} --platform dotnet --language-version 2.2") .ToString(); // Act diff --git a/tests/Oryx.BuildImage.Tests/NodeJSSampleAppsTest.cs b/tests/Oryx.BuildImage.Tests/NodeJSSampleAppsTest.cs index ca9ab0f21b..c9eb978b76 100644 --- a/tests/Oryx.BuildImage.Tests/NodeJSSampleAppsTest.cs +++ b/tests/Oryx.BuildImage.Tests/NodeJSSampleAppsTest.cs @@ -345,7 +345,7 @@ public void GeneratesScript_AndBuilds_WhenExplicitLanguageAndVersion_AreProvided var appDir = volume.ContainerDir; var appOutputDir = "/tmp/webfrontend-output"; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -i /tmp/int -o {appOutputDir} -l nodejs --language-version 8.2.1") + .AddBuildCommand($"{appDir} -i /tmp/int -o {appOutputDir} --platform nodejs --language-version 8.2.1") .AddDirectoryExistsCheck($"{appOutputDir}/node_modules") .ToString(); @@ -412,7 +412,7 @@ public void CanBuild_UsingScriptGeneratedBy_ScriptOnlyOption_AndWhenExplicitLang var generatedScript = "/tmp/build.sh"; var tempDir = "/tmp/" + Guid.NewGuid(); var script = new ShellScriptBuilder() - .AddScriptCommand($"{appDir} -l nodejs --language-version 8.2.1 > {generatedScript}") + .AddScriptCommand($"{appDir} --platform nodejs --language-version 8.2.1 > {generatedScript}") .SetExecutePermissionOnFile(generatedScript) .CreateDirectory(tempDir) .AddCommand($"{generatedScript} {appDir} {appOutputDir} {tempDir}") @@ -564,7 +564,7 @@ public void Build_ExecutesPreAndPostBuildScripts_WithinBenvContext() var appDir = volume.ContainerDir; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -l nodejs --language-version 6") + .AddBuildCommand($"{appDir} --platform nodejs --language-version 6") .ToString(); // Act @@ -708,7 +708,7 @@ public void BuildNodeApp_ConfigureAppInsights_WithCorrectNodeVersion_AIEnvironme // Arrange var volume = CreateWebFrontEndVolume(); var appDir = volume.ContainerDir; - var spcifyNodeVersionCommand = "-l nodejs --language-version=" + version; + var spcifyNodeVersionCommand = "--platform nodejs --language-version=" + version; var nestedOutputDir = "/tmp/output"; var script = new ShellScriptBuilder() .AddCommand( @@ -760,7 +760,7 @@ public void BuildNodeApp_DoesNotConfigureAppInsights_WithWrongNodeVersion_AIEnvi var volume = CreateWebFrontEndVolume(); var appDir = volume.ContainerDir; var nestedOutputDir = "/tmp/output"; - var spcifyNodeVersionCommand = "-l nodejs --language-version=" + version; + var spcifyNodeVersionCommand = "--platform nodejs --language-version=" + version; var script = new ShellScriptBuilder() .AddCommand( $"oryx build {appDir} -o {nestedOutputDir} {spcifyNodeVersionCommand} --log-file {appDir}/1.log") @@ -810,7 +810,7 @@ public void BuildNodeApp_DoesNotConfigureAppInsights_WithCorrectNodeVersion_AIEn var volume = CreateWebFrontEndVolume(); var appDir = volume.ContainerDir; var nestedOutputDir = "/tmp/output"; - var spcifyNodeVersionCommand = "-l nodejs --language-version=" + version; + var spcifyNodeVersionCommand = "--platform nodejs --language-version=" + version; var script = new ShellScriptBuilder() .AddCommand( $"oryx build {appDir} -o {nestedOutputDir} {spcifyNodeVersionCommand} --log-file {appDir}/1.log") diff --git a/tests/Oryx.BuildImage.Tests/PhpSampleAppsTest.cs b/tests/Oryx.BuildImage.Tests/PhpSampleAppsTest.cs index b4dc138446..b1c13ed7c4 100644 --- a/tests/Oryx.BuildImage.Tests/PhpSampleAppsTest.cs +++ b/tests/Oryx.BuildImage.Tests/PhpSampleAppsTest.cs @@ -62,7 +62,7 @@ public void GeneratesScript_AndBuilds_WithoutComposerFile() var appDir = volume.ContainerDir; var script = new ShellScriptBuilder() .AddCommand($"rm {appDir}/composer.json") - .AddBuildCommand($"{appDir} --language php --language-version {PhpVersions.Php73Version}") + .AddBuildCommand($"{appDir} --platform php --language-version {PhpVersions.Php73Version}") .ToString(); // Act diff --git a/tests/Oryx.BuildImage.Tests/PythonSampleAppsTest.cs b/tests/Oryx.BuildImage.Tests/PythonSampleAppsTest.cs index 9f3e731bff..282f49022b 100644 --- a/tests/Oryx.BuildImage.Tests/PythonSampleAppsTest.cs +++ b/tests/Oryx.BuildImage.Tests/PythonSampleAppsTest.cs @@ -289,7 +289,7 @@ public void ErrorDuringBuild_ResultsIn_NonSuccessfulExitCode() var appOutputDir = "/tmp/app-output"; var tempDir = "/tmp/" + Guid.NewGuid(); var script = new ShellScriptBuilder() - .AddScriptCommand($"{appDir} -l python --language-version {langVersion} > {generatedScript}") + .AddScriptCommand($"{appDir} --platform python --language-version {langVersion} > {generatedScript}") .SetExecutePermissionOnFile(generatedScript) .CreateDirectory(tempDir) .AddCommand($"{generatedScript} {appDir} {appOutputDir} {tempDir}") @@ -324,7 +324,7 @@ public void GeneratesScript_AndBuilds_WhenExplicitLanguageAndVersion_AreProvided var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/output"; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -o {appOutputDir} -l python --language-version {Settings.Python36Version}") + .AddBuildCommand($"{appDir} -o {appOutputDir} --platform python --language-version {Settings.Python36Version}") .ToString(); // Act @@ -361,7 +361,7 @@ public void CanBuild_UsingScriptGeneratedBy_ScriptOnlyOption() var tempDir = "/tmp/" + Guid.NewGuid(); var script = new ShellScriptBuilder() .AddScriptCommand( - $"{appDir} -l python --language-version {Settings.Python36Version} > {generatedScript}") + $"{appDir} --platform python --language-version {Settings.Python36Version} > {generatedScript}") .SetExecutePermissionOnFile(generatedScript) .CreateDirectory(tempDir) .AddCommand($"{generatedScript} {appDir} {appOutputDir} {tempDir}") @@ -398,7 +398,7 @@ public void CanthrowException_ForInvalidPythonVersion() var appOutputDir = "/tmp/app-output"; var tempDir = "/tmp/" + Guid.NewGuid(); var script = new ShellScriptBuilder() - .AddScriptCommand($"{appDir} -l python --language-version 4.0.1 > {generatedScript}") + .AddScriptCommand($"{appDir} --platform python --language-version 4.0.1 > {generatedScript}") .SetExecutePermissionOnFile(generatedScript) .CreateDirectory(tempDir) .AddCommand($"{generatedScript} {appDir} {appOutputDir} {tempDir}") @@ -439,7 +439,7 @@ public void CanBuild_Python2_WithScriptOnlyOption() var appOutputDir = "/tmp/app-output"; var tempDir = "/tmp/" + Guid.NewGuid(); var script = new ShellScriptBuilder() - .AddScriptCommand($"{appDir} -l python --language-version {langVersion} > {generatedScript}") + .AddScriptCommand($"{appDir} --platform python --language-version {langVersion} > {generatedScript}") .SetExecutePermissionOnFile(generatedScript) .CreateDirectory(tempDir) .AddCommand($"{generatedScript} {appDir} {appOutputDir} {tempDir}") @@ -626,7 +626,7 @@ public void Build_InstallsVirtualEnvironment_AndPackagesInIt() var appOutputDir = "/tmp/app-output"; var script = new ShellScriptBuilder() .AddBuildCommand( - $"{appDir} -o {appOutputDir} -l python --language-version {PythonVersions.Python37Version}") + $"{appDir} -o {appOutputDir} --platform python --language-version {PythonVersions.Python37Version}") .AddDirectoryExistsCheck($"{appOutputDir}/pythonenv3.7/lib/python3.7/site-packages/flask") .ToString(); @@ -965,7 +965,7 @@ public void Django_CollectStaticFailure_DoesNotFailBuild() var appOutputDir = "/tmp/app-output"; var script = new ShellScriptBuilder() .AddBuildCommand( - $"{appDir} -o {appOutputDir} -l python --language-version {PythonVersions.Python37Version}") + $"{appDir} -o {appOutputDir} --platform python --language-version {PythonVersions.Python37Version}") .ToString(); // Act @@ -1031,7 +1031,7 @@ public void Build_ExecutesPreAndPostBuildScripts_WithinBenvContext(string versio var appDir = volume.ContainerDir; var appOutputDir = "/tmp/app-output"; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -o {appOutputDir} -l python --language-version {version}") + .AddBuildCommand($"{appDir} -o {appOutputDir} --platform python --language-version {version}") .ToString(); // Act @@ -1091,7 +1091,7 @@ public void GeneratesScript_AndBuilds_DjangoApp_RunningCollectStatic(string disa } var script = scriptBuilder .AddBuildCommand( - $"{appDir} -o {appOutputDir} -l python --language-version {PythonVersions.Python37Version}") + $"{appDir} -o {appOutputDir} --platform python --language-version {PythonVersions.Python37Version}") // These css files should be available since 'collectstatic' is run in the script .AddFileExistsCheck($"{appOutputDir}/staticfiles/css/boards.css") .AddFileExistsCheck($"{appOutputDir}/staticfiles/css/uservoice.css") @@ -1133,7 +1133,7 @@ public void GeneratesScript_AndBuilds_Shapely_With_Python(string version) var appDir = volume.ContainerDir; var appOutputDir = "/tmp/app-output"; var script = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -o {appOutputDir} -l python --language-version {version}") + .AddBuildCommand($"{appDir} -o {appOutputDir} --platform python --language-version {version}") .ToString(); // Act @@ -1176,7 +1176,7 @@ public void GeneratesScript_AndBuilds_DjangoApp_WithoutRunningCollectStatic_IfDi var script = new ShellScriptBuilder() .AddCommand($"export {EnvironmentSettingsKeys.DisableCollectStatic}={disableCollectStatic}") .AddBuildCommand( - $"{appDir} -o {appOutputDir} -l python --language-version {PythonVersions.Python37Version}") + $"{appDir} -o {appOutputDir} --platform python --language-version {PythonVersions.Python37Version}") // These css files should NOT be available since 'collectstatic' is set off .AddFileDoesNotExistCheck($"{appOutputDir}/staticfiles/css/boards.css") .AddFileDoesNotExistCheck($"{appOutputDir}/staticfiles/css/uservoice.css") diff --git a/tests/Oryx.Integration.Tests/DotNetCoreEndToEndTests.cs b/tests/Oryx.Integration.Tests/DotNetCoreEndToEndTests.cs index 10a4a8bdeb..e98b461bfe 100644 --- a/tests/Oryx.Integration.Tests/DotNetCoreEndToEndTests.cs +++ b/tests/Oryx.Integration.Tests/DotNetCoreEndToEndTests.cs @@ -62,7 +62,7 @@ public async Task CanBuildAndRun_NetCoreApp10WebApp() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotNetCoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotNetCoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -114,7 +114,7 @@ public async Task CanBuildAndRun_NetCore11WebApp() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -158,7 +158,7 @@ public async Task CanBuildAndRun_NetCore11WebApp_HavingExplicitAssemblyName() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -210,7 +210,7 @@ public async Task CanBuildAndRun_NetCoreApp20WebApp() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotNetCoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotNetCoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -262,7 +262,7 @@ public async Task CanBuildAndRun_NetCore21WebApp_UsingDefaultPublishOutputDirect var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/{DotNetCoreConstants.OryxOutputPublishDirectory}"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -305,7 +305,7 @@ public async Task CanRunApp_WithoutBuildManifestFile() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -o {appOutputDir} -l dotnet --language-version {dotnetcoreVersion}") + .AddCommand($"oryx build {appDir} -o {appOutputDir} --platform dotnet --language-version {dotnetcoreVersion}") .AddFileExistsCheck($"{appOutputDir}/{FilePaths.BuildManifestFileName}") // NOTE: Delete the manifest file explicitly .AddCommand($"rm -f {appOutputDir}/{FilePaths.BuildManifestFileName}") @@ -352,7 +352,7 @@ public async Task CanRunApp_NetCore21WebApp_NetCoreApp21WithExplicitAssemblyName var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -o {appOutputDir} -l dotnet --language-version {dotnetcoreVersion}") + .AddCommand($"oryx build {appDir} -o {appOutputDir} --platform dotnet --language-version {dotnetcoreVersion}") .AddFileExistsCheck($"{appOutputDir}/{FilePaths.BuildManifestFileName}") // NOTE: Delete the manifest file explicitly .AddCommand($"rm -f {appOutputDir}/{FilePaths.BuildManifestFileName}") @@ -400,7 +400,7 @@ public async Task CanBuildAndRun_NetCore21WebApp_WhenOutputDirIsCurrentDirectory var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() // NOTE: Make sure the current directory is the output directory @@ -445,7 +445,7 @@ public async Task CanBuildAndRun_NetCore21WebApp_HavingExplicitAssemblyName() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -505,7 +505,7 @@ public async Task CanBuildAndRun_NetCore21WebApp_UsingExplicitStartupCommand(str var appOutputDir = $"{appDir}/myoutputdir"; var tempAppDir = "/tmp/app"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand($"mkdir -p {tempAppDir}") @@ -553,7 +553,7 @@ public async Task CanBuildAndRun_UsingExplicitStartupScriptFile() var appOutputDir = $"{appDir}/myoutputdir"; var tempAppDir = "/tmp/app"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand($"mkdir -p {tempAppDir}") @@ -693,7 +693,7 @@ public async Task CanBuildAndRunApp_WhenOutputIsZipped_AndIntermediateDir_IsNotU var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}" + + $"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}" + $" -p {ScriptGenerator.Constants.ZipAllOutputBuildPropertyKey}=true") .ToString(); var runtimeImageScript = new ShellScriptBuilder() @@ -738,7 +738,7 @@ public async Task CanBuildAndRunApp_WhenOutputIsZipped_AndIntermediateDir_IsUsed var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}" + + $"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}" + $" -p {ScriptGenerator.Constants.ZipAllOutputBuildPropertyKey}=true") .ToString(); var runtimeImageScript = new ShellScriptBuilder() @@ -1004,7 +1004,7 @@ public async Task CanBuildAndRun_NetCore22WebApp() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); // NOTE: Do NOT change this as we want to make sure that all the non-existent directories in the path @@ -1053,7 +1053,7 @@ public async Task CanBuildAndRun_NetCore22WebApp_UsingDebugConfiguration() var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() .SetEnvironmentVariable(EnvironmentSettingsKeys.MSBuildConfiguration, "Debug") - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -1096,7 +1096,7 @@ public async Task DotNetCoreStartupScript_UsesPortEnvironmentVariableValue() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand($"export PORT={ContainerPort}") @@ -1140,7 +1140,7 @@ public async Task StartupScript_UsesSuppliedBindingPort_EvenIfPortEnvironmentVar var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand($"export PORT=9095") @@ -1185,7 +1185,7 @@ public async Task CanBuildAndRun_NetCore22WebApp_HavingExplicitAssemblyName_With var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .AddFileExistsCheck($"{appOutputDir}/foo bar.dll") .ToString(); var runtimeImageScript = new ShellScriptBuilder() @@ -1327,7 +1327,7 @@ public async Task CanBuildAndRun_NetCore30WebApp() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -1463,7 +1463,7 @@ public async Task CanBuildAndRun_NetCore30WebApp_UsingExplicitStartupCommand() var appOutputDir = $"{appDir}/myoutputdir"; var startupCommand = "./NetCoreApp30.WebApp"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -o {appOutputDir} -l dotnet --language-version {dotnetcoreVersion}") + .AddCommand($"oryx build {appDir} -o {appOutputDir} --platform dotnet --language-version {dotnetcoreVersion}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( @@ -1507,7 +1507,7 @@ public async Task CanBuildAndRun_NetCore30WebApp_HavingExplicitAssemblyName() var appDir = volume.ContainerDir; var appOutputDir = $"{appDir}/myoutputdir"; var buildImageScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") + .AddCommand($"oryx build {appDir} --platform dotnet --language-version {dotnetcoreVersion} -o {appOutputDir}") .ToString(); var runtimeImageScript = new ShellScriptBuilder() .AddCommand( diff --git a/tests/Oryx.Integration.Tests/NodeEndToEndTests.cs b/tests/Oryx.Integration.Tests/NodeEndToEndTests.cs index 30e817c203..8bcddf24b5 100644 --- a/tests/Oryx.Integration.Tests/NodeEndToEndTests.cs +++ b/tests/Oryx.Integration.Tests/NodeEndToEndTests.cs @@ -70,7 +70,7 @@ public async Task CanBuildAndRunNodeApp_UsingZippedNodeModules_WithoutExtracting .ToString(); var buildScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -i /tmp/int -o /tmp/out -l nodejs " + + $"oryx build {appDir} -i /tmp/int -o /tmp/out --platform nodejs " + $"--language-version {nodeVersion} -p compress_node_modules=tar-gz") .AddCommand($"cp -rf /tmp/out/* {appOutputDir}") .ToString(); @@ -125,9 +125,9 @@ public async Task CanBuildAndRunNodeApp_OnSecondBuild_AfterZippingNodeModules_In .ToString(); var buildScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -i /tmp/int -o /tmp/out -l nodejs " + + $"oryx build {appDir} -i /tmp/int -o /tmp/out --platform nodejs " + $"--language-version {nodeVersion} -p compress_node_modules=tar-gz") - .AddCommand($"oryx build {appDir} -i /tmp/int -o /tmp/out -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} -i /tmp/int -o /tmp/out --platform nodejs --language-version {nodeVersion}") .AddCommand($"cp -rf /tmp/out/* {appOutputDir}") .ToString(); @@ -180,9 +180,9 @@ public async Task CanBuildAndRunNodeApp_OnSecondBuild_AfterNotZippingNodeModules .AddCommand(DefaultStartupFilePath) .ToString(); var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -i /tmp/int -o /tmp/out -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} -i /tmp/int -o /tmp/out --platform nodejs --language-version {nodeVersion}") .AddCommand( - $"oryx build {appDir} -i /tmp/int -o /tmp/out -l nodejs " + + $"oryx build {appDir} -i /tmp/int -o /tmp/out --platform nodejs " + $"--language-version {nodeVersion} -p compress_node_modules=tar-gz") .AddCommand($"cp -rf /tmp/out/* {appOutputDir}") .ToString(); @@ -222,7 +222,7 @@ public async Task CanBuildAndRun_NodeApp(string nodeVersion) var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -263,7 +263,7 @@ public async Task NodeStartupScript_UsesPortEnvironmentVariableValue() var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"export PORT={ContainerPort}") @@ -305,7 +305,7 @@ public async Task NodeStartupScript_UsesSuppliedBindingPort_EvenIfPortEnvironmen var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"export PORT=9095") @@ -348,7 +348,7 @@ public async Task CanBuildAndRunNodeApp_UsingYarnForBuild_AndExplicitOutputFile( var appDir = volume.ContainerDir; var startupFilePath = "/tmp/startup.sh"; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -output {startupFilePath} -bindPort {ContainerPort}") @@ -380,7 +380,7 @@ public async Task CanBuildNodeAppUsingScriptsNodeInPackageJson() var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -421,7 +421,7 @@ public async Task Node_Lab2AppServiceApp() var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -462,7 +462,7 @@ public async Task Node_SoundCloudNgrxApp() var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -506,7 +506,7 @@ public async Task Node_CreateReactAppSample() var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -561,7 +561,7 @@ public async Task Node_CreateReactAppSample_zippedNodeModules(string nodeVersion .ToString(); var buildScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -i /tmp/int -o /tmp/out -l nodejs " + + $"oryx build {appDir} -i /tmp/int -o /tmp/out --platform nodejs " + $"--language-version {nodeVersion} -p compress_node_modules=zip") .AddCommand($"cp -rf /tmp/out/* {appOutputDir}") .ToString(); @@ -592,7 +592,7 @@ public async Task Node_CreateReactAppSample_SingleImage() var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx run-script {appDir} --debug --platform nodejs --platform-version {nodeVersion} " + @@ -636,7 +636,7 @@ public async Task CanBuildAndRun_NodeExpressApp_UsingSingleImage_AndCustomScript "#!/bin/bash\n" + $"PORT={ContainerPort} node server.js\n"); var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx run-script {appDir} --debug --platform nodejs --platform-version {nodeVersion} " + @@ -677,7 +677,7 @@ public async Task CanBuildAndRun_NodeExpressApp_UsingSingleImage_AndCustomStartu // Create a custom startup command const string customRunCommand = "'npm start'"; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx run-script {appDir} --debug --platform nodejs --platform-version {nodeVersion} " + @@ -725,7 +725,7 @@ public async Task Test_NodeSassExample(string nodeVersion) var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l nodejs --language-version {nodeVersion}") + .AddCommand($"oryx build {appDir} --platform nodejs --language-version {nodeVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -791,7 +791,7 @@ public async Task CanBuildAndRunNodeApp_UsingZippedNodeModules(string compressFo .ToString(); var buildScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -i /tmp/int -o /tmp/out -l nodejs " + + $"oryx build {appDir} -i /tmp/int -o /tmp/out --platform nodejs " + $"--language-version {nodeVersion} -p compress_node_modules={compressFormat}") .AddCommand($"cp -rf /tmp/out/* {appOutputDir}") .ToString(); @@ -839,7 +839,7 @@ public async Task CanBuildAndRun_NodeApp_WithAppInsights_Configured(string nodeV var appName = "linxnodeexpress"; var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; - var spcifyNodeVersionCommand = "-l nodejs --language-version=" + nodeVersion; + var spcifyNodeVersionCommand = "--platform nodejs --language-version=" + nodeVersion; var aIKey = "APPINSIGHTS_INSTRUMENTATIONKEY"; var buildScript = new ShellScriptBuilder() .AddCommand($"oryx build {appDir} -o {appDir} {spcifyNodeVersionCommand} --log-file {appDir}/1.log") @@ -916,7 +916,7 @@ public async Task CanBuildAndRunNodeApp_WithDebugger(string nodeVersion) .ToString(); var buildScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -i /tmp/int -o /tmp/out -l nodejs " + + $"oryx build {appDir} -i /tmp/int -o /tmp/out --platform nodejs " + $"--language-version {nodeVersion} -p compress_node_modules=tar-gz") .AddCommand($"cp -rf /tmp/out/* {appOutputDir}") .ToString(); diff --git a/tests/Oryx.Integration.Tests/PhpEndToEndTests.cs b/tests/Oryx.Integration.Tests/PhpEndToEndTests.cs index aef620aaa4..131e4d7820 100644 --- a/tests/Oryx.Integration.Tests/PhpEndToEndTests.cs +++ b/tests/Oryx.Integration.Tests/PhpEndToEndTests.cs @@ -53,7 +53,7 @@ public async Task TwigExample(string phpVersion) var volume = DockerVolume.CreateMirror(hostDir); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l php --language-version {phpVersion}") + .AddCommand($"oryx build {appDir} --platform php --language-version {phpVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -output {RunScriptPath}") @@ -107,7 +107,7 @@ public async Task WordPress51(string phpVersion) var volume = DockerVolume.CreateMirror(hostDir); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l php --language-version {phpVersion}") + .AddCommand($"oryx build {appDir} --platform php --language-version {phpVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -output {RunScriptPath}") @@ -150,7 +150,7 @@ public async Task ImagickExample(string phpVersion) var volume = DockerVolume.CreateMirror(hostDir); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l php --language-version {phpVersion}") + .AddCommand($"oryx build {appDir} --platform php --language-version {phpVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -output {RunScriptPath}") diff --git a/tests/Oryx.Integration.Tests/PythonEndToEndTests.cs b/tests/Oryx.Integration.Tests/PythonEndToEndTests.cs index 09a043fac4..4b5e16346d 100644 --- a/tests/Oryx.Integration.Tests/PythonEndToEndTests.cs +++ b/tests/Oryx.Integration.Tests/PythonEndToEndTests.cs @@ -147,7 +147,7 @@ public async Task CanBuildAndRunPythonApp_UsingPython27_AndExplicitOutputStartup var appDir = volume.ContainerDir; var startupFile = "/tmp/startup.sh"; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l python --language-version 2.7") + .AddCommand($"oryx build {appDir} --platform python --language-version 2.7") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -output {startupFile} -bindPort {ContainerPort}") @@ -188,7 +188,7 @@ public async Task CanBuildAndRun_Python27App_UsingVirtualEnv() var appDir = volume.ContainerDir; const string virtualEnvName = "antenv2.7"; var buildScript = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -l python --language-version 2.7 -p virtualenv_name={virtualEnvName}") + .AddBuildCommand($"{appDir} --platform python --language-version 2.7 -p virtualenv_name={virtualEnvName}") .ToString(); var runScript = new ShellScriptBuilder() // Mimic the commands ran by app service in their derived image. @@ -242,7 +242,7 @@ public async Task CanBuildAndRunPythonApp(string pythonVersion) var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l python --language-version {pythonVersion}") + .AddCommand($"oryx build {appDir} --platform python --language-version {pythonVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -444,7 +444,7 @@ public async Task CanBuildAndRun_DjangoPython37App_UsingVirtualEnv() var buildScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -i /tmp/int -o /tmp/out -l python --language-version 3.7 " + + $"oryx build {appDir} -i /tmp/int -o /tmp/out --platform python --language-version 3.7 " + $"-p virtualenv_name={virtualEnvName}") .AddCommand($"cp -rf /tmp/out/* {appOutputDir}") .ToString(); @@ -505,7 +505,7 @@ public async Task CanBuildAndRunPythonApp_UsingPython36() var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l python --language-version 3.6") + .AddCommand($"oryx build {appDir} --platform python --language-version 3.6") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -590,10 +590,10 @@ public async Task BuildWithVirtualEnv_RemovesOryxPackagesDir_FromOlderBuild(stri // Simulate apps that were built using package directory, and then virtual env var buildScript = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -l python --language-version {pythonVersion}") + .AddBuildCommand($"{appDir} --platform python --language-version {pythonVersion}") .AddBuildCommand( $"{appDir} -p virtualenv_name={virtualEnvName} " + - $"-l python --language-version {pythonVersion}") + $"--platform python --language-version {pythonVersion}") .ToString(); var runScript = new ShellScriptBuilder() @@ -646,7 +646,7 @@ public async Task CanBuildAndRun_DjangoPython36App_UsingVirtualEnv() var appDir = volume.ContainerDir; const string virtualEnvName = "antenv3.6"; var buildScript = new ShellScriptBuilder() - .AddBuildCommand($"{appDir} -l python --language-version 3.6 -p virtualenv_name={virtualEnvName}") + .AddBuildCommand($"{appDir} --platform python --language-version 3.6 -p virtualenv_name={virtualEnvName}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -695,7 +695,7 @@ public async Task CanBuildAndRun_DjangoApp_UsingPython36() var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l python --language-version 3.6") + .AddCommand($"oryx build {appDir} --platform python --language-version 3.6") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -747,7 +747,7 @@ public async Task CanBuildAndRun_MultiPlatformApp_HavingReactAndDjango() var buildScript = new ShellScriptBuilder() .AddCommand("export ENABLE_MULTIPLATFORM_BUILD=true") - .AddBuildCommand($"{appDir} -l python --language-version 3.7") + .AddBuildCommand($"{appDir} --platform python --language-version 3.7") .ToString(); var runAppScript = new ShellScriptBuilder() @@ -816,7 +816,7 @@ public async Task CanBuildAndRun_ShapelyFlaskApp_UsingVirtualEnv(string pythonVe var volume = CreateAppVolume(appName); var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() - .AddCommand($"oryx build {appDir} -l python --language-version {pythonVersion}") + .AddCommand($"oryx build {appDir} --platform python --language-version {pythonVersion}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}") @@ -860,7 +860,7 @@ public async Task CanBuildAndRun_ShapelyFlaskApp_PackageDir(string pythonVersion var appDir = volume.ContainerDir; var buildScript = new ShellScriptBuilder() .AddCommand( - $"oryx build {appDir} -l python --language-version {pythonVersion} -p packagedir={packageDir}") + $"oryx build {appDir} --platform python --language-version {pythonVersion} -p packagedir={packageDir}") .ToString(); var runScript = new ShellScriptBuilder() .AddCommand($"oryx -appPath {appDir} -bindPort {ContainerPort}")