Learning .NET?

I never thought I’ll do that. Going to .NET for any implementation felt like a betrayal to all that is sacred. Or in other words switching the domain to Microsoft felt strange and even wrong.

I’m used to Linux and all that is Unix like. Now I’m installing .NET and Visual Studio on my Mac. How I got here?

It’s simple. I had a chat with company who needs DevOps and they are running only .NET apps. I think that DevOps is not pinned to platform or any tech. It’s a way of thinking so helping them out with a casual brainstorming felt nice. Those guys are awesome and smart. They know what they want to achieve.

  • Going away from monolithic app
  • Microservices
  • Use PaaS from Azure
  • Automated deployments
  • CI/CD

So far they have one Excel sheet. That has all steps for their deployment. I’m guessing that there is an order that should be followed. They need their components interconnected and maybe a better branching strategy. They are using git and branching from master every time they want to develop a feature. That’s all nice and good but probably not enough for a decent CI.

Today I looked up some information of how things looks like on the .NET world. For example for docker I saw this nice page:

https://docs.docker.com/engine/examples/dotnetcore/#build-and-run-the-docker-image

The Dockerfile for this simple MVC app boils down to:

FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "aspnetapp.dll"]

When I built it the /app had those:

> ┌─[✗]─[root@phoenix]─[~]
└──╼ # docker exec aspnetcore_sample ls
appsettings.Development.json
appsettings.json
aspnetapp.PrecompiledViews.dll
aspnetapp.PrecompiledViews.pdb
aspnetapp.deps.json
aspnetapp.dll
aspnetapp.pdb
aspnetapp.runtimeconfig.json
bower.json
bundleconfig.json
web.config
wwwroot
┌─[root@phoenix]─[~]

So, the .NET framework was serving the views from a compiled .dll file. That brings back memories. I think this Windows world evolved a lot since I last cared to look. The funny thing is that my docker container was running on Linux. So the whole thing is very platform agnostic.

I think I should research some more. Next stop - Jenkins. That might be a nice read:

https://blog.couchbase.com/continuous-deployment-with-jenkins-and-net/

Categories:

Updated: