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.

  • Using MongoDB Docker on .NET Core
  • How to know if my program is completely started inside my docker with compose
  • Zero downtime deploy to azure as an docker container
  • Travis ci in docker failing
  • Multiservice application in Teamcity - composing branches
  • How to create docker image with .net core that reference to .net 4.6 class library
  • 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.

  • Insert Docker parent host ip into container's hosts file
  • Docker with Angular 4 and Django is compiled successfully but localhost:4200 is not working
  • Understanding a simple dockerfile of postgresql
  • Linking a SQL Server with a liferay instance running in a docker container
  • What are the benefits of provisioning a Docker container with Ansible instead of a Dockerfile?
  • When does the docker volume become available for CMD script?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.