CI/CD Building a C# Project in Jenkins

The goal for this stage of development is to get our C# project listed in Jenkins and building. The next iteration will be adding testing.

This step follows the work from CI/CD Scanning GitHub for Repositories from Jenkins, where Jenkins is set up to scan for projects, but it now needs the files required to build.

Continue reading

CI/CD Scanning GitHub for Repositories from Jenkins

The next step is to get Jenkins to search GitHub for repositories to build.

I want all the projects in my GitHub repository that qualify to be built automatically, so if I add a new project with the right setup, it will automatically build it.

This can be achieved by having Jenkins scan your GitHub repository to gather all projects. GitHub supports pushing to Jenkins when repositories change, but that is more complicated when Jenkins is behind a firewall and cannot be directly contacted (we’ll be relying on polling in this case instead).

Continue reading

CI/CD Visual Studio Project Layout

As described in https://www.oneoddsock.com/2022/04/02/personal-ci-cd/, the goal of setting up the CI/CD automation is to:

  • Break up my more monolithic solutions into much smaller, more consumable components
  • Automate testing of my code
  • Improve potential for code sharing with others
  • Greater visibility of code/test status through reporting

To facilitate this, I’ll structure my Visual Studio solutions in GitHub so Jenkins can access them and run builds and tests.

The sample project is published on GitHub for reference at: https://github.com/FineRedMist/jenkins-project-sample-dotnet

For reference, I’m using Visual Studio 2022 Community Edition. I’m configuring the projects to use .NET 6.0.

Continue reading

Personal CI/CD

I have a number of personal projects with code scattered about, where if I want to include code from one project into another I generally either need to copy code or find more sophisticated ways to share.

After going through interviewing coop student candidates and seeing their projects and GitHub repositories (when provided) I realized that documenting the process and demonstrating the value you can get out of it would be substantial.

The motivation for me is to take my projects to a higher level of rigour and improve reuse. Furthermore, I want to automate builds, validation by content tests, notifications, etc.

I do use GitHub for storing my projects which are primarily in C# but I want to amp up my setup to another level. The feature I want are:

  1. Get my projects from GitHub
  2. Build them
  3. Run tests on them
  4. Post main branch builds to a NuGet repository
  5. Post main branch symbols to a symbol server
  6. Generate notifications to Slack (I have my own setup for the family) about build status.

I already have a machine I use locally for service-related work. Switching to Linux would be non-trivial due to some of the services being run.

So the following setup will be using Windows, but I don’t think it will be entirely dissimilar to Linux.

The software I’m looking at using for all of these are:

Anything else that comes up during setup will be documented along the way.