官术网_书友最值得收藏!

Setting Up a CI Environment

In the remainder of this book, we're going to implement Continuous Integration, Delivery, and Deployment. However, before we start, we must choose some software to work with. As I have mentioned, we have multiple choices for our source control and for our CI server and, of course, we can use a ton of programming languages and databases. Additionally, we need to create some project to work with. This chapter will lay out the technologies that are used in the remainder of the book, as well as a high-level overview of how they all work together. For the test project, we'll create a simple to-do list web app. We'll implement it in Node.js with a MongoDB database and in C# Core with a PostgreSQL database. That way, we'll see CI in action in both frontend and backend development, as well as the popular JavaScript language, the compiled C# .NET Core language, SQL, and NoSQL.

We'll start by building a frontend using JavaScript and the npm package manager, creating unit tests and UI tests in Selenium and Jasmine, and automating these using Karma and Gulp. After that, we'll hook it up to a JavaScript-driven Node.js and MongoDB backend.

With the same frontend, we can build a C# .NET Core and PostgreSQL database backend. We'll use NuGet and Microsoft's unit testing framework as well as MSBuild and MSTest.

Chapter 1, Continuous Integration, Delivery, and Deployment Foundations, starts with source control. For this book, I have chosen Git, as it is a widely used source control system. As for the CI server, we are going to use Jenkins. Both Git and Jenkins are free and can be downloaded and used privately and professionally at no cost. In a real-world scenario, you would install Git and Jenkins on one or two servers that your entire team can access. Likewise, your database may get a separate server as well. However, since you and I, as poor programmers, probably do not have an idle server (or two) laying around, we will make use of Virtual Machines (which is like a computer on your computer). Later on, we will also need an environment to deploy to, so that could be a second or third Virtual Machine (VM). For our VMs, we are going to use Oracle VM VirtualBox. This software is also free to use. Of course, any VM is going to need an operating system, just like a normal computer. I may have given it away earlier, but I am a Windows user. Unfortunately, I don't have some spare Windows licenses laying around and I am guessing you haven't either. Luckily, there is another popular operating system that is free to use and can run Git, Jenkins, JavaScript, and anything we are going to use throughout this book. You have probably guessed that the operating system is Linux. As for the Linux distribution, I am using Ubuntu Server, as it is one of the most used Linux distributions out there (if not the most used). Do not worry, I expect no prior knowledge of any of the tools I mentioned, so I will be taking you through the installations step by step.

I should mention that running a VM is pretty heavy work for your computer, let alone running two. After all, your computer will be running multiple operating systems and all the programs in it. If you have less than 8 GB RAM memory, I recommend not installing everything on your VM (it is possible, but it will not run very smoothly). There is one tool in this book, GitLab for Git, that really needs Linux to run on. You will also need some space on your hard disk. The minimum recommended size for a new VM is 8 GB, but that is not enough for our environment. I would use 30 GB just to be safe (especially if you plan on installing a user interface). We are going to install some other software as well, so reserve at least 40 GB to be on the safe side (for two VMs).

My own system runs Windows 10 and has 16 GB RAM memory, so all of the examples in this book are guaranteed to work on Windows 10 (probably 8 and even 7 as well). The examples may work on Linux and even Mac, but I have not tested them. Some of the explanations are Windows-specific, but most of it is pretty generic.

You may have noticed that we are going to use C# .NET Core. C# .NET traditionally only works on Windows (unless you use Mono), but, with the recently released .NET Core, that is all in the past. With .NET Core, an official light version of .NET, you can code C# and run it everywhere. Of course, it would be nice if we could also develop that application everywhere. The Visual Studio flagship editor from Microsoft still only works on Windows. Luckily, Microsoft realized that too and created Visual Studio Code, a lightweight editor for all your .NET code.
主站蜘蛛池模板: 洛川县| 环江| 定远县| 抚州市| 信宜市| 大田县| 湄潭县| 新巴尔虎左旗| 肥东县| 剑河县| 雅安市| 宁蒗| 三亚市| 晋江市| 广水市| 潼关县| 银川市| 新密市| 咸阳市| 常州市| 琼海市| 鹰潭市| 安达市| 遂川县| 丰顺县| 同心县| 凤庆县| 衡水市| 伊金霍洛旗| 祁阳县| 晋江市| 游戏| 莫力| 大埔区| 金秀| 武胜县| 互助| 永善县| 昭平县| 岳阳市| 孝义市|