This image has a compiled version of metrics.exe, that is set up to scan a provided solution
390
This Docker image contains a compiled version of metrics.exe, designed to scan a provided .NET Framework solution. The primary intent is to facilitate the generation of Visual Studio Code metrics within CI pipelines, especially those like GitHub Actions.
Ensure you have Docker and Docker Compose installed on your development machine or CI pipeline environment.
To use this Docker image effectively, follow these steps. Create or update a docker-compose.yml file with the following content:
services:
metrics:
image: jeppeholt/metrics
volumes:
- ${PROJECT_DIR}:C:/app
- C:/results:C:/results
environment:
- SOLUTION_NAME=${SOLUTION_NAME}
PROJECT_DIR: This should be set to the root directory of your project.SOLUTION_NAME: This should be the name of your solution (the .sln file).C:/results directory inside the container. This is mounted to C:/results on the host machine but can be easily changed.Setup Environment Variables: Before running the Docker Compose command, ensure these environment variables are correctly set in your CI pipeline configuration or your local shell environment.
Run Docker Compose: Execute the following command to start the process:
docker-compose up
Once the process completes, a file named report.xml will be deposited in the C:/results directory.
Here’s a simplified GitHub Actions workflow example to illustrate how you might integrate this Docker image:
name: Generate Metrics
on: [push]
jobs:
metrics:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Compose
run: docker-compose up
env:
PROJECT_DIR: ${{ github.workspace }}
SOLUTION_NAME: 'YourSolutionName.sln'
You can modify the mount point of the results directory if you do not want it to default to C:/results. For example:
services:
metrics:
image: jeppeholt/metrics
volumes:
- ${PROJECT_DIR}:C:/app
- /custom/results/directory:C:/results
environment:
- SOLUTION_NAME=${SOLUTION_NAME}
After making these changes, simply run the Docker Compose command, and report.xml will be available in the specified results directory.
By following these steps, you can easily integrate .NET Framework solution metrics generation into your CI pipelines using this Docker image. The dockerfiles can be found here: https://github.com/JeppeJonHolt/Metrics_Pipeline/tree/main
Content type
Image
Digest
sha256:46ee3538d…
Size
4 GB
Last updated
over 2 years ago
docker pull jeppeholt/metrics