Generic projection runner infrastructure.
class ProjectionContext : Be.Vlaanderen.Basisregisters.ProjectionHandling.Runner.RunnerDbContext<ProjectionContext> { ... }
class Projections : Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector.ConnectedProjection<ProjectionContext> { ... }
class ProjectionContextMigrationHelper : RunnerDbContextMigrationHelper<ProjectionContext> {
public ProjectionContextMigrationHelper(
string connectionString,
ILoggerFactory loggerFactory)
: base(
connectionString,
new HistoryConfiguration
{
Schema = "MigrationsSchema",
Table = "MigrationTablesHistoryTable"
},
loggerFactory)
{ }
protected override ProjectionContext CreateContext(DbContextOptions<ExtractContext> migrationContextOptions)
{
return new ProjectionContext(migrationContextOptions);
}
}
Autofac.ContainerBuilder builder;
// Register Projector module
builder.RegisterModule<ProjectorModule>();
// Register migration helpers for a ProjectionContext
builder
.RegisterProjectionMigrator<ProjectionContextMigrationFactory>(configuration, loggerFactory);
// Register ConnectedProjections for a projection context
builder
.RegisterProjections<Projections, ProjectionContext>();
// Register ConnectedProjections that require initialisation parameters
builder
.RegisterProjections<Projections, ProjectionContext>(
() => new Projections(parameter1, parameter2, ...)
);
// Register ConnectedProjections that require initialisation parameters and/or automically resolved dependencies
builder
.RegisterProjections<Projections, ProjectionContext>(
container => new Projections(parameter1, container.Resolve<TDependency>(), ...)
);
IConnectedProjectionsManager projectionManager;
// Status of registered projections
var projectsStatus = projectionManager.GetRegisteredProjections();
// Start all registered projections
projectionManager.Start();
// Start a specific projection by id
projectionManager.Start(projection);
// Stop all registered projections
projectionManager.Stop();
// Stop a specific projection by id
projectionManager.Stop(projection);
Inherit Controller from DefaultProjectionContoller
[ApiRoute("controller-path")]
public class ProjectionsController : DefaultProjectorController
{
public ProjectionsController(IConnectedProjectionsManager connectedProjectionsManager)
: base(connectedProjectionsManager)
{ }
}
Status of registered projections: [GET] https://projector.url/controller-path/
Start all registered projections: [POST] https://projector.url/controller-path/start/all
Start a specific projection by id: [POST] https://projector.url/controller-path/start/{projection}
Stop all registered projections: [POST] https://projector.url/controller-path/stop/all
Stop a specific projection by id: [POST] https://projector.url/controller-path/stop/{projection}
- Fork and clone locally.
- Build the solution with Visual Studio,
build.cmd
orbuild.sh
. - Create a topic specific branch in git. Add a nice feature in the code. Do not forget to add tests and/or docs.
- Run
build.cmd
orbuild.sh
to make sure everything still compiles and all tests are still passing. - When built, you'll find the binaries in
./dist
which you can then test with locally, to ensure the bug or feature has been successfully implemented. - Send a Pull Request.
TODO: More to come :)
Our build.sh
script knows a few tricks. By default it runs with the Test
target.
The buildserver passes in BITBUCKET_BUILD_NUMBER
as an integer to version the results and BUILD_DOCKER_REGISTRY
to point to a Docker registry to push the resulting Docker images.
Run an npm install
to setup Commitizen and Semantic Release.
Checks if the requested .NET Core SDK and runtime version defined in global.json
are available.
We are pedantic about these being the exact versions to have identical builds everywhere.
Make sure we have a clean build directory to start with.
Restore dependencies for debian.8-x64
and win10-x64
using dotnet restore and Paket.
Builds the solution in Release mode with the .NET Core SDK and runtime specified in global.json
It builds it platform-neutral, debian.8-x64
and win10-x64
version.
Runs dotnet test
against the test projects.
Runs a dotnet publish
for the debian.8-x64
and win10-x64
version as a self-contained application.
It does this using the Release configuration.
Packs the solution using Paket in Release mode and places the result in the dist
folder.
This is usually used to build documentation NuGet packages.
- .NET Core - MIT
- .NET Core Runtime - CoreCLR is the runtime for .NET Core. It includes the garbage collector, JIT compiler, primitive data types and low-level classes. - MIT
- .NET Core APIs - CoreFX is the foundational class libraries for .NET Core. It includes types for collections, file systems, console, JSON, XML, async and many others. - MIT
- .NET Core SDK - Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI. - MIT
- .NET Core Docker - Base Docker images for working with .NET Core and the .NET Core Tools. - MIT
- .NET Standard definition - The principles and definition of the .NET Standard. - MIT
- Entity Framework Core - Entity Framework Core is a lightweight and extensible version of the popular Entity Framework data access technology. - Apache License 2.0
- Roslyn and C# - The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs. - Apache License 2.0
- F# - The F# Compiler, Core Library & Tools - MIT
- F# and .NET Core - F# and .NET Core SDK working together. - MIT
- ASP.NET Core framework - ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux. - Apache License 2.0
- Paket - A dependency manager for .NET with support for NuGet packages and Git repositories. - MIT
- FAKE - "FAKE - F# Make" is a cross platform build automation system. - MIT
- xUnit - xUnit.net is a free, open source, community-focused unit testing tool for the .NET Framework. - Apache License 2.0
- Autofac - An addictive .NET IoC container. - MIT
- AutoFixture - AutoFixture is an open source library for .NET designed to minimize the 'Arrange' phase of your unit tests in order to maximize maintainability. - MIT
- FluentAssertions - Fluent API for asserting the results of unit tests. - Apache License 2.0
- npm - A package manager for JavaScript. - Artistic License 2.0
- semantic-release - Fully automated version management and package publishing. - MIT
- semantic-release/changelog - Semantic-release plugin to create or update a changelog file. - MIT
- semantic-release/commit-analyzer - Semantic-release plugin to analyze commits with conventional-changelog. - MIT
- semantic-release/exec - Semantic-release plugin to execute custom shell commands. - MIT
- semantic-release/git - Semantic-release plugin to commit release assets to the project's git repository. - MIT
- semantic-release/npm - Semantic-release plugin to publish a npm package. - MIT
- semantic-release/github - Semantic-release plugin to publish a GitHub release. - MIT
- semantic-release/release-notes-generator - Semantic-release plugin to generate changelog content with conventional-changelog. - MIT
- commitlint - Lint commit messages. - MIT
- commitizen/cz-cli - The commitizen command line utility. - MIT
- commitizen/cz-conventional-changelog A commitizen adapter for the angular preset of conventional-changelog. - MIT
- Be.Vlaanderen.Basisregisters.ProjectionHandling - Lightweight projection handling infrastructure. - MIT
- Be.Vlaanderen.Basisregisters.Build.Pipeline - Contains generic files for all Basisregisters Vlaanderen pipelines. - MIT