Creating a CI pipeline for .net containerized applications
As the title says, I am trying to put together a CI (Continuous Integration) pipeline for a raft of .NET services which are going to be run in a dockerized environment in Linux. The developers at my organisation use C#, and VSO/TFS currently, so we are attempting to migrate to a Linux platform while retaining the tooling/skill-set of our current team.
I have seen a lot of posts on various forums, but have been unable to find anything that addresses my specific need – so if this has been answered before – I would very much appreciate a link!
So far, I have done the following to try to prove what I can do:
- Created a C# project with a unit test.
- Checked the project into source control (TFS online)
- Running Jenkins on a linux box
- Set up Jenkins to listen for pushes into source control.
- When new code detected, a build is kicked off on a Jenkins node (which is a Windows machine) using MSBuild plug-in
- If build completes without errors, use MSTest plug-in to run all the unit tests associated to the C# project.
All the above seems to work just fine – it’s the next bit that I am struggling with.
What I want to do
Now that I have a build completed and tested in code, I want to be able to do the following (at a high level):
- Move source code from the Jenkins windows node to a Jenkins Linux node
- Build a docker container on the Linux node
- Push the docker container into a repository
What I have tried
I am using a freestyle project in Jenkins to orchestrate the above. (Not sure if this is the right choice – but seems to do the pull/build/test without breaking a sweat.)
I figured that in order to get the code from the Windows node to the Linux node, I would need to push into a GIT repository. My requirement is that this is a local GIT, but if that is not possible, I am open to using a private GIT online.
I tried setting up a local Gogs-GIT repository, but Jenkins doesn’t speak the same language as it. In any case – I haven’t been able to figure out how to use any of the Jenkins plug-ins to push code as a post build event from my Windows node into a different source control environment than where it came from in the first place.
I am now thinking that maybe I need to execute some sort of custom script (maybe a batch script on the Windows node) to do a push into GIT and then have a separate Jenkins job that listens for pushes to the GIT repository to start the Linux process.
I am pretty new to both Linux and Jenkins, so any help or pointers would be much appreciated.