Creating a CI pipeline for .net containerized applications

My Goal

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.

  • Azure App Service + Docker Autodeploy?
  • Docker not hosting anything on the port it says it is, what's going on?
  • Travis ci in docker failing
  • Is there Jenkins or other open-source CI for a distributed system?
  • How do you use docker-compose from a Gitlab Registry on DigitalOcean?
  • Same job in parallel on more Docker containers
  • 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:

    1. Created a C# project with a unit test.
    2. Checked the project into source control (TFS online)
    3. Running Jenkins on a linux box
    4. Set up Jenkins to listen for pushes into source control.
    5. When new code detected, a build is kicked off on a Jenkins node (which is a Windows machine) using MSBuild plug-in
    6. 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):

    1. Move source code from the Jenkins windows node to a Jenkins Linux node
    2. Build a docker container on the Linux node
    3. 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.

  • git push not working from jenkins docker
  • cannot open shared object file
  • Unable to bring apache2 home page in my browser while configuring nodes by puppet
  • How can I copy a file from one folder to another folder within a container in Docker?
  • dockerfile - Unable to connect error
  • Warning: Module 'curl' already loading in Unknown on line 0 (Fix this from a custom.php.ini file)
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.