Adding more logging for procfiles (#1240)

* Populate prebuild and postbuild from procfile

* Changed \n to ; for multiple commands

* Modifying based on PR comments

* Modified feature name and added tests

* Fixed some tests

* Made changes based on PR comments

* Changes to make the validation tests succeed

* Updated the readme

* Fixing bug in FileExists

* Update DefaultBuildScriptGenerator.cs

* Update DefaultBuildScriptGenerator.cs

* Update DefaultBuildScriptGenerator.cs

* Changed based on comments

* Adding more logging for procfiles

* Adding a couple more logging statements

* Updated readme

Co-authored-by: William Hernandez-Limon <williamhe@microsoft.com>
This commit is contained in:
tulikac 2022-02-21 12:59:18 +05:30 коммит произвёл GitHub
Родитель f101a41595
Коммит 44d172746a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 12 добавлений и 5 удалений

Просмотреть файл

@ -55,6 +55,11 @@ placed; if not specified the source directory is used for output as well.
For all options, specify `oryx --help`.
### `oryx create-script -appPath`
When `oryx` is run in the runtime images it generates a start script named
run.sh, by default in the same folder as the compiled artifact.
### Support for Build Configuration File
You can provide some extra build related information in an app.yaml in your content
@ -75,10 +80,6 @@ post-build: |
Oryx will read the yaml and run the commands provided for pre-build and post-build.
### `oryx create-script -appPath`
When `oryx` is run in the runtime images it generates a start script named
run.sh, by default in the same folder as the compiled artifact.
## Build and run an app

Просмотреть файл

@ -316,7 +316,6 @@ namespace Microsoft.Oryx.BuildScriptGenerator
buildProperties[ManifestFilePropertyKeys.CompressDestinationDir] =
_cliOptions.CompressDestinationDir.ToString().ToLower();
// Workaround for bug in TestSourceRepo class in validation tests
// Should be using context.SourceRepo.FileExists
string filePathForAppYaml = Path.Combine(context.SourceRepo.RootPath, "app.yaml");
@ -327,6 +326,7 @@ namespace Microsoft.Oryx.BuildScriptGenerator
if (File.Exists(filePathForAppYaml))
{
_logger.LogDebug("Found app.yaml");
_writer.WriteLine("Found app.yaml");
try
{
BuildConfigurationFIle buildConfigFile = BuildConfigurationFIle.Create(context.SourceRepo.ReadFile("app.yaml"));
@ -336,6 +336,8 @@ namespace Microsoft.Oryx.BuildScriptGenerator
_cliOptions.PreBuildScriptPath = null;
_logger.LogDebug("Overriding the pre-build commands with the app.yaml section");
_logger.LogDebug(_cliOptions.PreBuildCommand.ToString());
_writer.WriteLine("Overriding the pre-build commands with the app.yaml section");
_writer.WriteLine(_cliOptions.PreBuildCommand.ToString());
}
if (!string.IsNullOrEmpty(buildConfigFile.postbuild))
@ -344,11 +346,15 @@ namespace Microsoft.Oryx.BuildScriptGenerator
_cliOptions.PostBuildScriptPath = null;
_logger.LogDebug("Overriding the post-build commands with the app.yaml section");
_logger.LogDebug(_cliOptions.PostBuildCommand.ToString());
_writer.WriteLine("Overriding the post-build commands with the app.yaml section");
_writer.WriteLine(_cliOptions.PostBuildCommand.ToString());
}
}
catch (Exception ex)
{
_logger.LogWarning("Invalid app.yaml format", ex);
_writer.WriteLine("Invalid app.yaml format " + ex);
}
}
else