This makes template dotnet core console app happen
- Serilog for logging and all the extensibility including plugins to push to loki
- Spectre.Console for amazing interactive console applications.
- NUnit for unit tests
- FluentAssertions for readable assertions
- Docker for easy deployment and setting up of developer environment
- MakeFile because it just works!
This project comes with a development container will all the tooling required to build publish and deploy a project. Simply run the following commands to start development in the container.
# bring up dev environment
make build up
# test the project
make test
# run default package
make start
# build the project ready for publish
make publish
To deploy a docker image you can use the following commands
# Build docker images and push to repository
make docker-build docker-login docker-push
# or just
make docker-publish
# to make an additional release of the docker image for this branch
make docker-pull-short-tag docker-tag-env env=latest
# to update the deployment call
make deploy env=dev
Before you begin, ensure you have met the following requirements:
- Docker installed on your machine. See Docker installation guide.
- Git, for version control. Install Git.
- Ability to run make file, eg.
wsl
make up
: brings up the container & attach to the default containermake down
: stops the containermake build
: builds the container
start
: Run the Template dotnet core console apptest
: Test the Template dotnet core console apppublish
: Publish the Template dotnet core console appdocker-login
: Login to docker registrydocker-build
: Build the docker imagedocker-push
: Push the docker imagedocker-pull-short-tag
: Pull the docker image based in git short hashdocker-tag-env
: Tag the docker image based in the environmentdocker-publish
: Publish the docker imagedeploy
: Deploy the Template dotnet core console appupdate-packages
: Update the packages`
dotnet new classlib -n TemplateDotnetCoreConsoleApp.Core -o ./src/TemplateDotnetCoreConsoleApp.Core
dotnet new nunit -n TemplateDotnetCoreConsoleApp.Core.Tests -o ./tests/TemplateDotnetCoreConsoleApp.Core.Tests
dotnet sln TemplateDotnetCoreConsoleApp.sln add ./src/TemplateDotnetCoreConsoleApp.Core/TemplateDotnetCoreConsoleApp.Core.csproj
dotnet sln TemplateDotnetCoreConsoleApp.sln add ./tests/TemplateDotnetCoreConsoleApp.Core.Tests/TemplateDotnetCoreConsoleApp.Core.Tests.csproj
dotnet sln TemplateDotnetCoreConsoleApp.sln list
Semantic Versioning (SemVer) is a versioning scheme for software that conveys meaning about the underlying changes. It's composed of three segments:
- Major version (
MAJOR
): Incremented for incompatible API changes. - Minor version (
MINOR
): Incremented for backward-compatible functionality additions. - Patch version (
PATCH
): Incremented for backward-compatible bug fixes.
Updating version numbers:
- Manual updates to
MAJOR
andMINOR
versions using aversionPrefix
variable in the makefile. - Automatic determination of
PATCH
levels based on commit messages in themain
branch. - Addition of pre-release identifiers for non-main branches, derived from the commit delta between feature branches and the main branch.
To test what the current version is just call
make version
Our project adheres to a modified version of the Git Flow workflow, tailored to streamline our release process.
- Creation: Developers create feature branches off the
main
branch for new features or bug fixes. - Naming Convention: Feature branches are named with the prefix
feature/
followed by a descriptive name (e.g.,feature/add-login
). - Bug fixes: Branches are named with the prefix
bug/
followed by a descriptive name (e.g.,bug/fix-login-button
).
- The
main
branch holds the production-ready code. - Changes from
feature
are merged intomain
when they are complete - The build pipeline will deploy from
main
to development environments as required
- Tagging: Instead of creating a release branch, we use tags to mark a new release.
- Process:
- When we're ready to release, we ensure that
main
is stable and all desired changes for the release have been merged. - We then create a tag from the
main
branch with the version number, following Semantic Versioning (e.g.,v1.2.0
). - The tagged commit in the
main
branch is considered the official release of that version.
- When we're ready to release, we ensure that
- Hotfixes are created off the
v1.xxx
tag if urgent fixes are needed in production. - Once completed, hotfixes are merged back into both
main
, and a new tag is created to mark the hotfix release (e.g.,v1.2.1
).
Question: Can I use this application on Windows or Linux?
Answer: Yes, the application is cross-platform and can be run on Linux, macOS, and Windows.
Question: How do I update to the latest version?
Answer: Pull the latest changes from the repository and rebuild your Docker container.
- https://opensource.com/article/18/8/what-how-makefile What is a Makefile and how does it work?