Skip to content

FromDoppler/conversion-tool

Repository files navigation

conversion-tool

Conventional Commits

Tool for convert content from a format to another format.

Started from a basic template for a Doppler microservice based on .NET with CI, CD, Code Formatting, Authentication, and other common practices in Doppler teams.

Context

We base our CI/CD process on GitHub Actions and Packages, Docker Hub, and Docker Swarm.

GitHub Action generates the images. We refer to these generated images in a Docker Swarm using an auto-redeploy approach. The Doppler Swarm repository stores the configuration of our Docker Swarm.

You can find a detailed description of our Git flow and the relation with Docker Hub in the following:

  • Pull Requests generates images with tags like pr-177 (pr-{pull request id}) and (pr-{pull request id}-{commit id}).

  • Merging in main generates images with tags like main and main-60737d6 (main-{commit id}). In general, these images are deployed automatically into the QA environment.

  • Resetting the branch INT generates images with tags like INT and INT-60737d6 (INT-{commit id}). In general, these images are deployed automatically into the INT environment.

  • Tagging with the format v#.#.# generates images with tags like v1, v1.3, v1.3.0, v1.3.0_982c388. In general, our Production environment refers to images with tags like v1 (only the mayor), so, depends on that, these images could be deployed automatically to the Production environment.

Features

  • Base conventions for a .NET/C# project.

  • Normalize to Linux line endings by default for all files (See .editorconfig and .gitattributes).

  • Ignore from git and docker files with the convention that denotes secrets (See .gitignore and .dockerignore).

  • Prettier validation for all supported files.

  • Editor Config validation using dotnet-format

  • Launch and debug settings for VS Code (.vscode) and Visual Studio (launchSettings.json).

  • Custom color for VS Code (using Peacock, see settings.json).

  • Format validation, build and test run in CI process.

  • Generation of the docker images following Doppler convention and publish them to Docker Hub and to Github Packages

  • Generation of version.txt file with the image version in wwwroot. Also, expose it using static files middleware.

  • demo.http to easily add manual tests for the exposed API with VS Code REST Client.

  • Exposing only HTTP (not HTTPS) because that is the responsibility of our reverse proxy.

  • Allow overriding project settings based on our Doppler conventions.

  • Expose Swagger (with support for segment prefix).

  • Including an example of a self-hosting integration test.