Server Automation (4), Jenkins

Introduction

This article is about Jenkins, an automation server, that works with SVN together as a client-server pair. So, when I wrote the TortoiseSVN page, I thought I should write another article to introduce Jenkins in this series. But, afterward, I realized in this article series, all articles are Client-side related, so it would be better to make a server-side series of articles to collect all server-side topics together. Therefore, I have the following Server Automation series of articles:

where all other articles are published under the Source Control series, related to the server. Furthermore, I like the automation keyword. The all processes discussed are really automation, when we now in the AI age, I believe the Automation is the earlier concept to describe AI, or we may just say: automation is AI. In this article, I will address automation, actually, Jenkinis itself is a major tool for automation.

A - Introduction

In this article, we will describe What Jenkins is and its major features. The content of this article:

  • A: Introduction
  • B: What Jenkins is
  • C: Demo for Jenkins major CI Processes
    • C-0: Get the Latest Version of a LOD from Jenkins
    • C-1: Create a LOD from Jenkins
    • C-2: Create a Snapshot
    • C-3: Deploy a Snapshot to Server (DEV, QA, UAT, PROD)
    • C-4: Promote a Snapshot to the next level (QA, UAT, PROD)

B - What is Jenkins?

Definition 1 [ref].

Jenkins is a self-contained, open-source automation server that can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.

Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.

Definition 2 [ref].

Jenkins is an open source continuous integration (CI) server. It manages and controls several stages of the software delivery process, including build, documentation, automated testing, packaging, and static code analysis. Jenkins is a highly popular DevOps tool used by thousands of development teams.

Jenkins automation is commonly triggered by code changes in repositories like GitHub, Bitbucket, and GitLab and integrates with build tools like Maven and Gradle. Jenkins supports the use of container technologies like Docker and Kubernetes for testing and packaging of software releases, but it is neither a Kubernetes-native solution nor a container-native CI solution.

Definition 3 [wiki]

Jenkins is an open-source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat. It supports version control tools, including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, ClearCase, and RTC, and can execute Apache Ant, Apache Maven, and sbt based projects as well as arbitrary shell scripts and Windows batch commands.

Definition 4: this is also from wiki, but in Chinese version [wiki], (translated back to English), There is some new info.

Jenkins is an open-source continuous integration tool written in Java. Following a dispute with Oracle, the project was forked from the Hudson Project.

Jenkins provides continuous integration services for software development. It runs in a servlet container (e.g. Apache Tomcat). It supports software configuration management (SCM) tools (including AccuRev SCMCVSSubversionGitPerforceClearcase and RTC), which can execute Apache Ant and Apache Maven-based projects, as well as arbitrary shell scripts and Windows batch commands. The main developer of Jenkins is Kosuke Kawaguchi. Jenkins is free software released under the MIT license.

Keywords

  • Automation Server == CI Server: related to building, testing, and delivering or deploying software.
  • Supports Version Control Tools: AccuRev, CVS, Subversion, Git, Mercurial, Perforce, ClearCase, and RTC
  • Developed by Java
  • Open Source

As discussed, the major key word for Jenkins is Automation Server, the following sections, we will concentrate to discuss each automation process about Repos, Build, Test, Staging, Production.

Jenkins strategy

C - Demo for Jenkins Major Automation Processes

The Processes include:

  • C-0: Get the Latest Version of a LOD from Jenkins
  • C-1: Create a LOD from Jenkins
  • C-2: Create a Snapshot
  • C-3: Deploy a Snapshot to Server (DEV, QA, UAT, PROD)
  • C-4: Promote a Snapshot to the next level (QA, UAT, PROD)

I will show the processes by Jenkins running screenshats.

The following is a Jenkins Dashboard, an interface to access the Jenkins server.

C -0, Get the Latest version of a LOD from Jenkins

Choose a Project:

Choose Production:

Choose Deploy

Choose Database:

Choose a Specific Database:

Find the latest Build:

Check Console Output:

Open Console Output:

At the bottom:

C -1, Create a LOD from Jenkins

Creates LOD(Line of Development) in SVN Repositories. LOD is somewhat like the Branch in other repositories.

From Jenkins Dashboard, CLICK Self_Service:

CLICK: scmCreateLOD

CLICK Build with Parameters:

Set the parameters, then CLICK Build:

After successfully running,

CL: ICK Console Output:

 

C-2: Create a Snapshot

Snapshot is somewhat like a push of a Branch, it will pulled into the working flow, from one server to another server, DEV, TEST, STAGE, PROD.

Starting from the Dashboard => CLICK Self Service

Choose scmCreateSnapshot

In scmCreateSnapshot Window, Choose Lods

Click: Build with Parameters:

Build:

Click the successfully built version:

Check Console Output:

In the Console Output page, you will see your snapshot is created successfully:

C-3: Deploy a Snapshot to Server (DEV, QA, UAT, PROD)

The deployment for the servers, DEV, QA, UAT, PROD, are the same or similar, we will demostrate the DEV deployment only.From Jenkins Dashboard: choose the product line, such as CAHCO

Choose DEV:

Deploy:

Choose Database; as we demonstrate here, we use the database.

Choose the specific Database:

Set parameters:

Build:

Check the result:

from Console Output:

Result in Console Output:

C-4: Promote a Snapshot to the next level (QA, UAT, PROD)

The promotion processes from DEV to QA, from QA to UAT, and from UAT to PROD are the same. We demostrate one, UAT, the others are the same.Self_Service

Choose: PromoteToQA/UAT/PROD

Promote to UAT:

Check Result:

The result is good.

References


Similar Articles