Skip to content

Commit

Permalink
VCI-100: vc-build - release 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri Kargapolov committed Aug 13, 2021
1 parent fda8365 commit c6d6ddc
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Introduction


The VirtoCommerce Global Tool (vc-build) is the official CLI [.NET Core GlobalTool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) that helps you build, test and deploy releases, create and push NuGet packages, provide package management for projects based on VirtoCommerce, and automate common DevOps tasks. It is powered by [nuke.build](https://nuke.build/) - a cross-platform build automation system with C# DSL, that provides an approach to embrace existing IDE tooling and state where everyone in a team can manage and change the build scenarios. This allows writing build scenarios in C# and debugging them in Visual Studio. Also, along with crossplatform support, it was the best choice for us to build our own build automation solution on top of this project.
The VirtoCommerce Global Tool (vc-build) is the official CLI [.NET Core GlobalTool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) that helps you build, test and deploy releases, create and push NuGet packages, provide package management for projects based on VirtoCommerce, and automate common DevOps tasks. It is powered by [nuke.build](https://nuke.build/) - a cross-platform build automation system with C# DSL, that provides an approach to embrace existing IDE tooling and state where everyone in a team can manage and change the build scenarios. This allows writing build scenarios in C# and debugging them in Visual Studio. Also, along with cross-platform support, it was the best choice for us to build our own build automation solution on top of this project.

Check out [the project source code](https://github.com/VirtoCommerce/vc-build) for the implementation details.

Expand All @@ -12,9 +12,9 @@ Check out [the project source code](https://github.com/VirtoCommerce/vc-build) f
[Build automation](docs/CLI-tools/build-automation.md)

- build and bundle a module project (both managed and scripted parts)
- discovere and run all the unit tests from the solution
- discover and run all the unit tests from the solution
- create and publish NuGet packages for projects from your solution, this can be helpful if you intend to re-use a module's logic in another project, you will be able to quickly publish the needed version as a NuGet package. In the private or public NuGet registry
- include targets that allow to perform various additional quality checks such as static code analysis (currently we support out-of-the-box integration with SonarCloud)
- include targets that allow performing various additional quality checks such as static code analysis (currently we support out-of-the-box integration with SonarCloud)

[Packages management](docs/CLI-tools/package-management.md)

Expand All @@ -25,10 +25,10 @@ Check out [the project source code](https://github.com/VirtoCommerce/vc-build) f
[The platform cold start optimization and data migration (WIP)](docs/CLI-tools/cold-start-and-data-migration.md)

- platform start optimization (slow run on Azure case)
- get idempotent SQL scripts for all modules EF migrations with ability to apply them in a specific order without installed platform and source code (helpful for migration from VirtoCommerce platform version 2 (latest) to version 3)
- get idempotent SQL scripts for all modules EF migrations with the ability to apply them in a specific order without installed platform and source code (helpful for migration from VirtoCommerce platform version 2 (latest) to version 3)

## Before you start
Before you start using `VirtoCommerce.GlobalTool`, install the following in order to use all it's functionality:
Before you start using `VirtoCommerce.GlobalTool`, install the following in order to use all its functionality:

- .NET SDK 5.x
- Node.js 12.x
Expand All @@ -52,9 +52,9 @@ dotnet tool update VirtoCommerce.GlobalTool -g
```

## Getting started
To use `VirtoCommerce.GlobalTool` by invoke the tool using the following command: `vc-build`
To use `VirtoCommerce.GlobalTool` by invoke the tool run the following command: `vc-build`

To get the all list of targets:
To get the list of all targets:
```console

vc-build help
Expand Down
18 changes: 9 additions & 9 deletions docs/CLI-tools/build-automation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The `vc-build` contains a set of targets that designed to automate the various build scenarios for solution based on VC and moreover thanks to builder-server agnostic nature and cross-platform support it can be integrated into any exists CI/CD pipeline with different build services, or used for manual dev scenarios.
The `vc-build` contains a set of targets that are designed to automate the various build scenarios for solutions based on VirtoCommerce and moreover, thanks to builder-server agnostic nature and cross-platform support, it can be integrated into any existing CI/CD pipeline with different build services, or used for local development scenarios.

![vc-build CLI](../media/cli-tools-2.png)

Expand All @@ -7,7 +7,7 @@ The `vc-build` contains a set of targets that designed to automate the various
```console
vc-build compile -configuration <Debug|Release>
```
Builds .NET Core solution of vc module.
Compile .NET Core solution.

### Parameters:

Expand All @@ -18,7 +18,7 @@ Builds .NET Core solution of vc module.
```console
vc-build test (with no args)
```
Is used to build the solution and runs all unit tests are discovered from the projects that are located in the solution folder and satisfied by this mask `*.Tests|*.Testing`.
Is used to compile the solution and runs all unit tests are discovered from the projects that are located in the solution folder and satisfied by this mask `*.Tests|*.Testing`.

Also, this target produces the test coverage and overall stats report.

Expand Down Expand Up @@ -69,8 +69,8 @@ vc-build pack -configuration <Debug|Release>
Builds the module solution and creates NuGet packages for all projects that have the `<IsPackable>` is set to `True` in the `.csproj` file.

The result of this target are NuGet packages that are stored by `artifacts` path of the module's root folder.
If execute this target for platform solution the version is taken from `Directory.Build.props`.
If executes this target for a module solution, the version is taken from module manifest file.
If execute this target for the platform solution the version is taken from `Directory.Build.props`.
If executes this target for a module solution, the version is taken from the module manifest file.

## PublishPackages

Expand All @@ -95,12 +95,12 @@ vc-build publishPackages -source C:\local-nuget
```console
vc-build compress (with no args)
```
Pack module into a distribution bundle zip that ready to be transferred to another platform instances or published. Executing this command in a module root folder, will put resulting zip into the `artifact` folder.
Pack the build artifacts into a distribution bundle zip that is ready to be transferred to a developer platform instance or published. Executing this command in a module root folder will put the resulting zip into the `artifact` folder.

This target normally checks and excludes from the resulting zip the all files that names are enumerated in these mutiple sources:
This target normally checks and excludes from the resulting zip all files which names are enumerated in these multiple sources:

- [global module.ignore](https://raw.githubusercontent.com/VirtoCommerce/vc-platform/dev/module.ignore) file that is managed by VC team
- local `module.ignore` file taken from the root folder of the module
- [global module.ignore](https://raw.githubusercontent.com/VirtoCommerce/vc-platform/dev/module.ignore) file that is managed by the VirtoCommerce team
- local `module.ignore` file that is taken from the root folder of the module

### Example:

Expand Down
4 changes: 2 additions & 2 deletions docs/CLI-tools/cold-start-and-data-migration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
As you may know the VirtoCommerce platform does a lot of work every start: check modules versions, files in probing path, copy modules files to probing path if they absent or have inappropriate versions, and so on. It coulld take time for the application to complete all of the necessary operations and be ready to work. Sometimes, especially on machines with low resources, you could see that the application failed to start and throwed the following error: `HTTP Error 500.30 - ANCM In-Process Start Failure`.
As you may know, the VirtoCommerce platform does a lot of work every start: check modules versions, files in probing path, copy modules files to probing path if they are absent or have inappropriate versions, and so on. It could take time for the application to complete all of the necessary operations and be ready to work. Sometimes, especially on machines with low resources, you could see that the application failed to start and throws the following error: `HTTP Error 500.30 - ANCM In-Process Start Failure`.

What is the solution?

From the VirtoCommerce platform version 3.27.0 there is an option `VirtoCommerce:RefreshProbingFolderOnStart` to avoid checking the probing path at the platform startup. This can decrease startup time at least by a third. If the option set to `false` and the probing path exists, the platform will start with the current probing path content on an “AS IS” basis. It is assumed that the probing path contains consistent module files. If the probing path is absent, then the platform will start as usual, with module discovering/copying, with no look at the option value.
From the VirtoCommerce platform version 3.27.0, there is an option `VirtoCommerce:RefreshProbingFolderOnStart` to avoid checking the probing path at the platform startup. This can decrease startup time at least by a third. If the option is set to `false` and the probing path exists, the platform will start with the current probing path content on an “AS IS” basis. It is assumed that the probing path contains consistent module files. If the probing path is absent, then the platform will start as usual, with module discovering/copying, with no look at the option value.
14 changes: 7 additions & 7 deletions docs/CLI-tools/introduction.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

The VirtoCommerce Global Tool (vc-build) is the official CLI [.NET Core GlobalTool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) that helps you build, test and deploy releases, create and push NuGet packages, provide package management for projects based on VirtoCommerce, and automate common DevOps tasks. It is powered by [nuke.build](https://nuke.build/) - a cross-platform build automation system with C# DSL, that provides an approach to embrace existing IDE tooling and state where everyone in a team can manage and change the build scenarios. This allows writing build scenarios in C# and debugging them in Visual Studio. Also, along with crossplatform support, it was the best choice for us to build our own build automation solution on top of this project.
The VirtoCommerce Global Tool (vc-build) is the official CLI [.NET Core GlobalTool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) that helps you build, test and deploy releases, create and push NuGet packages, provide package management for projects based on VirtoCommerce, and automate common DevOps tasks. It is powered by [nuke.build](https://nuke.build/) - a cross-platform build automation system with C# DSL, that provides an approach to embrace existing IDE tooling and state where everyone in a team can manage and change the build scenarios. This allows writing build scenarios in C# and debugging them in Visual Studio. Also, along with cross-platform support, it was the best choice for us to build our own build automation solution on top of this project.

Check out [the project source code](https://github.com/VirtoCommerce/vc-build) for the implementation details.

Expand All @@ -10,9 +10,9 @@ Check out [the project source code](https://github.com/VirtoCommerce/vc-build) f
[Build automation](./build-automation.md)

- build and bundle a module project (both managed and scripted parts)
- discovere and run all the unit tests from the solution
- discover and run all the unit tests from the solution
- create and publish NuGet packages for projects from your solution, this can be helpful if you intend to re-use a module's logic in another project, you will be able to quickly publish the needed version as a NuGet package. In the private or public NuGet registry
- include targets that allow to perform various additional quality checks such as static code analysis (currently we support out-of-the-box integration with SonarCloud)
- include targets that allow performing various additional quality checks such as static code analysis (currently we support out-of-the-box integration with SonarCloud)

[Packages management](./package-management.md)

Expand All @@ -23,10 +23,10 @@ Check out [the project source code](https://github.com/VirtoCommerce/vc-build) f
[The platform cold start optimization and data migration (WIP)](./cold-start-and-data-migration.md)

- platform start optimization (slow run on Azure case)
- get idempotent SQL scripts for all modules EF migrations with ability to apply them in a specific order without installed platform and source code (helpful for migration from VirtoCommerce platform version 2 (latest) to version 3)
- get idempotent SQL scripts for all modules EF migrations with the ability to apply them in a specific order without installed platform and source code (helpful for migration from VirtoCommerce platform version 2 (latest) to version 3)

## Before you start
Before you start using `VirtoCommerce.GlobalTool`, install the following in order to use all it's functionality:
Before you start using `VirtoCommerce.GlobalTool`, install the following in order to use all its functionality:

- .NET SDK 5.x
- Node.js 12.x
Expand All @@ -50,9 +50,9 @@ dotnet tool update VirtoCommerce.GlobalTool -g
```

## Getting started
To use `VirtoCommerce.GlobalTool` by invoke the tool using the following command: `vc-build`
To use `VirtoCommerce.GlobalTool` by invoke the tool run the following command: `vc-build`

To get the all list of targets:
To get the list of all targets:
```console

vc-build help
Expand Down
8 changes: 4 additions & 4 deletions docs/CLI-tools/package-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ vc-build install -module <module> -version <version>
vc-build install -module <module>:<version>
```

This command downloads and install into the current folder the platform or modules with versions that are passed as the command parameters or defined in `vc-package.json`.
This command downloads and installs into the current folder the platform or modules with versions that are passed as the command parameters or defined in `vc-package.json`.

`vc-package.json` - file is used to maintain the list of installed modules with their versions. This allows `vc-build` to easily restore the platform with the modules when on a different machine, such as a build server, without all those packages.


- `vc-build install (with no args)`

This target downloads and install into the current folder the platform and modules with versions described in `vc-package.json`.
This target downloads and installs into the current folder the platform and modules with versions described in `vc-package.json`.
If `vc-package.json` is not found in the local folder, by default the command will download and install the latest platform and modules versions that are marked with the `commerce` group.

By default, `install` target will install all modules listed as dependencies in `vc-package.json`.
Expand All @@ -28,7 +28,7 @@ vc-build install

- `vc-build install -platform -version <version>`

Fetch and install the platform with the specific version. If the platform with specified version does not exist in the registry, then this will fail.
Fetch and install the platform with the specific version. If the platform with a specified version does not exist in the registry, then this will fail.
If no version is specified, the latest platform version will be installed.

### Examples:
Expand Down Expand Up @@ -62,7 +62,7 @@ vc-build update -platform -version <version>
vc-build update -module <module> -version <version>
```
This command will update the platform and all modules listed to the version specified by `<version>`, respecting semver.
If `<version>` is not specified the component will updated to the latest version.
If `<version>` is not specified the component will be updated to the latest version.
If no args are specified, the platform and all modules in the specified location will be updated.

This command also updated the installed dependencies versions in the `vc-package.json`
Expand Down

0 comments on commit c6d6ddc

Please sign in to comment.