Posts

Showing posts with the label Systemd

Continuously deploy infrastructure with GitLab Pipeline

Continuously deploy infrastructure with Gitlab Pipeline Few weeks ago we saw how we could Setup continious integration and deployment to deploy an application using Gitlab Pipeline . We configured a service with systemd and had an ASP NET Core application automatically deployed when code was pushed to the repository. This automation allows us to reduce interaction with the server and reducing the manual work. The “infrastructure” configurations like systemd service files and nginx site files must also be created or edited on the server therefore it makes sense to also have them automatically deployed. On top of that, it makes even more sense to have them save in repository and source controlled. Today we will see how we can leverage Gitlab Pipeline to setup a continuous deployment for our infrastructure files in three parts: Setup the repository Setup the runner job Deploy the configurations 1. Setup the repository We start first by creating a repository with the same struct...

Setup a CI/CD pipeline with Gitlab for ASPNET Core on Ubuntu

Setup a CI/CD pipeline with Gitlab for ASPNET Core on Ubuntu Few weeks ago I explained how we could setup a CI/CD pipeline whereby the runner would be on Windows and the last stage was to package the application. Today we will see how we can setup a runner on Ubuntu CI server and use it to build and deploy an ASP MET Core application onto a Ubuntu 16.04 server. This post will be composed by three parts: Setup the runner on the CI server Setup the application on the server Setup the job in our project If you are unfamiliar with Gitlab pipeline and its terminology, you can read my previous post where I explain the main concepts behind GitLab pipeline with runner, jobs and stages . If you are unfamiliar with ssh and systemd, you can read my previous blog post on useful ssh commands and my previous blog post on how to manage Kestrel process with systemd . 1. Setup the runner on the CI server Setup the runner on your CI server by getting the package with apt-get. curl -L https...

Manage Kestrel process with systemd

Manage Kestrel process with systemd Kestrel is a lightweight standalone process. In order to host it on Linux, the recommended approach is to install it as a service. Systemd is a group of tools providing functionalities to manage processes on Ubuntu. Today we will see how we can manage an ASP NET Core application together with its Kestrel process using systemd tools. This post will be composed of three parts: Introduction Managing process with systemctl Debugging using journalctl 1. Introduction ASP NET Core application runs on top of Kestrel which is a lightweight standalone webserver. To be able to start to interact with our Ubuntu server we need to first establish an ssh connection. If you aren’t familiar with ssh, you can refer to my previous blog post where I provide explanations on how to setup ssh . Once we are on the server, we can get our libraries on the server and run: /usr/share/dotnet/dotnet myapp.dll This will run the app from the current session. When we ex...