Preface:

Everyone is looking at DevOPS, how to do continuous integration, continuous delivery, how to do CI/CD. As a continuous integration tool, Jenkins is actually just a platform or a big framework. Its work is completely dependent on plug-ins, which means that you can find whatever plug-ins you want to use. (A quote from somewhere else…)

1. Use gitee Pages

Do you want to deploy a static web page in the case of doing some local development without a server? Many code platforms have pages that are deployed as static sites, such as Github pages or the previous Preview feature, but Github seems to be getting disconnected quite easily these days, so I focused on Gitee Pages.

Because this is just a simple demo, I chose a very old static page demo of the project that most of us know, so let me say a few things about it:

I chose a branch (dev) to deploy static pages pointing to index.html in this directory. The path should be correct, otherwise the access project might be empty or something like that. Gitee Pages can also be used to package the deployment of the project

2. Jenkins installation

Install Jenkins for Linux:
  1. Download the Java JDK – 1.8.0 comes with

Yum install Java — 1.8.0 comes with its x86_64

  1. Yum Install Jenkins

Ps: The Jenkins version here is too low so I recommend another method for installing: install reference link

Wget HTTP: / / https://pkg.jenkins.io/redhat-stable/jenkins-2.176.3-1.1.noarch.rpm

  1. Install Jenkins

The RPM – ih Jenkins – 2.176.3-1.1. Noarch. RPM

PS: In addition, the version I installed here is too low, so many plug-ins failed to download and install.

Yum Upgrade Jenkins yum Update Jenkins

  1. Run Jenkins

Systemctl start jenkins.service Then open the address to access Jenkins, follow the prompt next step, enter the password of the corresponding directory to check the contents of the file, according to the default plug-in installation is also ok, own to install again can also be.

Tsinghua university image address: mirrors.tuna.tsinghua.edu.cn/jenkins/upd…

Just add exi /restart /reload to the end of your visit to Jenkins’ website

3. Simple CI/CD

Requirement: Create a hook to listen for the push behavior of the deploy branch, then automatically package and deploy.

Start Jenkins configuration and download the Gitee plugin

I created a new file on the server to send the script code

Now you can push the code to see if the HTML page has changed.

Of course, the above is the idea of automatic update deployment of Gitee Pages, pages is suitable for static web pages, such as some HTML pages of the project. If it’s a project deployment it’s really just changing the build script to your counterpart, like my other project that’s deployed on a server, doing auto-package and deploy, and then there’s time to talk about server project deployment and auto-package.

summary

Continuous integration is a software development practice in which team development members integrate their work frequently, usually at least once per member, which means that multiple integrations may occur per day. Each integration is verified by an automated build (including compilation, release, and automated testing) to find integration errors as quickly as possible. Many teams find that this process greatly reduces integration problems, allowing teams to develop cohesive software more quickly.

Actually, I was going to say do it yourself! Try it yourself! Try it yourself! Just try it a few more times