Write a short article and deploy the project using little Old Man Jenkins. There are more pictures, it’s like a nanny!

Recommended reading for Jenkins:

  • Introduction to Spring Boot Continuous Delivery of Jenkins
  • Impression Spring Cloud continuous Delivery Jenkins Primer corresponds to LabX-16

1. An overview of the

At present, the vast majority of domestic teams use Jenkins to realize continuous integration and continuous release. So what is Jenkins? The Jenkins User Documentation Center introduces the following:

Jenkins is an open source CI&CD software for automating a variety of tasks, including building, testing, and deploying software.

Jenkins supports a variety of operations, either through system packages, Docker, or through a standalone Java program.

The Jenkins user Documentation Center has provided a detailed tutorial, and has provided Chinese translation, very friendly. However, considering that chubby friends may want a more convenient and quick start tutorial, So Nai Nai wrote this article.

2. Quick start

In this section, we will set up a Jenkins service together and deploy a Spring Boot application to a remote server. The whole process is as follows:

  • 1. Set up a Jenkins service
  • 2. Configure Jenkins Global tools
  • 3. Create a Jenkins task. This task obtains the project from Git, builds it using Maven, and copies the jar package to the remote server. Finally, the Spring Boot application is started.

Friendship tip: the following necessary software, fat friends need to install their own.

Jenkins’ server:

  • JDK 8+
  • Maven 3+
  • Git

Remote server:

  • JDK 8+

Jenkins 2.1 build

2.1 download

Open the Jenkins Download page and select the Jenkins version you want. Here, we choose the Jenkins. War package, which is universal for all operating systems and cut version 2.204.1.

Create a directory
$ mkdir -p /Users/yunai/jenkins
$ cd /Users/yunai/jenkins

# download
$ wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war
Copy the code

2.1.2 Starting the Jenkins service

Run nohup Java -jar Jenkins. War & to start the Jenkins service in the background. Since Jenkins. war has a built-in Jetty server, it can be started directly without dropping it into a Tomcat or other container.

Run the tail -f nohup. Out command to view the startup logs. If the following log is displayed, the startup is successful:

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

e24a2134060f4604b45708904a4f7a25

This may also be found at: /Users/yunai/.jenkins/secrets/initialAdminPassword
Copy the code

By default, Jenkins has an administrator user built in. The user name is admin and the password is randomly generated. Here, we can see a bunch of e24a2134060f4604b45708904a4f7a25 is password.

2.2 Jenkins configuration

2.2.1 Getting Started

By default, Jenkins starts on8080Port. So, we can use the browser, accesshttp://127.0.0.1:8080/Address, go to Jenkins home page. Because we haven’t finished Jenkins at this pointAn introduction to, so is redirected to the “Getting Started” page. As shown below:

Enter the administrator password, we enter the “beginner” page. As shown below:

As a Jenkins newbie, of course we chose to “install the recommended plugin”. All we need to do is wait patiently for Jenkins to download the plugin automatically. As shown below:

Because the plug-in is downloaded from abroad, so the download speed may be slow, you can open B station to brush the video, ha ha ha. Of course, there may be plug-in download failure, just click retry, remain calm.

2.2.2 Administrator Configuration

After the plug-in is installed, the Create Your First Administrator page is displayed. As shown below:

Click “Save and Finish” button to complete the creation of an administrator account.

2.2.3 Example Configuration

After you create an administrator account, you are required to log in again. After you log in to the system using the new administrator account, the Instance Configuration page is displayed. As shown below:

Click the “Save and Finish” button to complete the configuration of the instance. At this point, click the “Reset” button to complete Jenkins’ restart. After that, wait patiently for Jenkins to complete the reboot and we will go to the Jenkins home page. As shown below:

2.2.4 Security other plug-ins

Although we have installed some plugins recommended by Jenkins in “2.2.1 Getting Started”, we still need to install the following plugins:

  • Maven Integration
  • Maven Info
  • Publish Over SSH
  • Extended Choice Parameter
  • Git Parameter

From the Jenkins home page, follow the order of “Manage Jenkins -> Manage Plugins” to enter the “Plug-in Management” screen. As shown below:

Select the plug-ins you want to install above, and then click the “Install Directly” button. The Install/Update Plug-in screen is displayed. As shown below:

After that, wait patiently for the plug-in installation to complete…

2.2.4 JDK configuration

From the Jenkins home page, enter the Global Tool Configuration screen in the sequence of Manage Jenkins -> Global Tool Configuration. As shown below:

Click the Add JDK button and uninstall Automatically option. After that, enter the local JAVA_HOME. As shown below:

When the configuration is complete, click the “Save” button at the bottom.

2.2.5 Maven configuration

From the Jenkins home page, enter the Global Tool Configuration screen in the sequence of Manage Jenkins -> Global Tool Configuration. As shown below:

Click the Add Maven button and uninstall Automatically option. After that, enter the local MAVEN_HOME. As shown below:

When the configuration is complete, click the “Save” button at the bottom.

2.2.6 SSH configuration

Since we are SSH copying the built JAR packages to the remote server, we need SSH configuration. Here, we use the authentication mode of account and password to achieve SSH connection to the remote server.

From the Jenkins home page, go to the “Configure” screen in the order of “Manage Jenkins -> Configure System”, then drop down to the bottom. As shown below:

Click the “Add” button and click the “Advanced” button. Then, configure SSH information for the remote server. As shown below:

When the configuration is complete, click the “Save” button at the bottom.

2.3 Configuring the Remote Server

On the remote server, we need to create the directory where the Java project will be deployed. Each company makes different catalog specifications, here Nai nai shares his own. Fixed in the /work/projects directory, create a deployment directory for each project. In addition, each project has a separate subdirectory. For example:

$ pwd
/work/projects/lab-41-demo01

$ ls
ls -ls
total 18852
    4 drwxr-xr-x 2 root root     4096 Jan 13 21:21 backup
    4 drwxr-xr-x 2 root root     4096 Jan 13 21:14 build
18840 -rw-r--r-- 1 root root 19288579 Jan 13 21:21 lab-41-demo01.jar
    4 drwxr-xr-x 2 root root     4096 Jan 13 21:16 shell
Copy the code
  • lab-41-demo01Directory, which will place all of an item.
  • At the end of eachThe childThe directory is divided into the following files/directories:
    • lab-41-demo01.jar: the project ofjarThe package.
    • buildCatalog: After Jenkins built the projectnew jarBag, uploadbuildDirectory, to avoid theThe original jarPackage overwrite, causing the Java service to fail properly.
    • backupTable of Contents: On historyjarBackup directory of the package. Every time you use a new onejarWhen starting the service, it will be oldjarMove to thebackupBack up data in the directory.
    • shellDirectory: script directory. At present, onlydeploy.shThe script, let’s take a look at it.

The entire deploy.sh script has less than 200 lines, so let’s take a look at the whole thing first. Later, chubby friends can click on the portal for a full view. The core code is as follows:

#! /bin/bash
set -e

# basis
# export JAVA_HOME = / work/designed/JDK/jdk1.8.0 _181
# export PATH=PATH=$PATH:$JAVA_HOME/bin
# export CLASSPATH=$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

DATE=$(date +%Y%m%d%H%M)
# Base path
BASE_PATH=/work/projects/lab-41-demo01
The address of the compiled JAR. During deployment, Jenkins uploads the JAR package to this directory
SOURCE_PATH=$BASE_PATH/build
# service name. It is also the name of the jar package used by the convention to deploy the service.
SERVER_NAME=lab-41-demo01
# environment
PROFILES_ACTIVE=prod
Health check URLHEALTH_CHECK_URL = http://127.0.0.1:8078/actuator/health/# heapError Save path
HEAP_ERROR_PATH=$BASE_PATH/heapError
# the JVM parameter
JAVA_OPS="-Xms1024m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$HEAP_ERROR_PATH"
# JavaAgent parameter. It can be used to configure link tracing such as SkyWalking
JAVA_AGENT=

# backup
function backup() {/ /... Omit code}Move the latest build code to the project environment
function transfer() {/ /... Omit code}# stop
function stop() {/ /... Omit code}# start
function start() {/ /... Omit code}# Health check
function healthCheck() {/ /... Omit code}# deployment
function deploy() {
    cd $BASE_PATH
    Back up the original JAR
    backup
    Stop the Java service
    stop
    Deploy the new JAR
    transfer
    Start the Java service
    start
    # Health check
    healthCheck
}

deploy
Copy the code
  • At the beginning, we’ve defined a bunch of variables that fat people can understand based on the comments on them.
  • At the end, we can see right#deploy()Method to deploy the project. The whole step is divided into 5 steps, corresponding to 5 methods respectively. Let’s look at it method by method.

1) backup

#backup() to backup the jar package to the backup directory. The code is as follows:

function backup() {
    If it does not exist, no backup is required
    if [ ! -f "$BASE_PATH/$SERVER_NAME.jar" ]; then
        echo "[backup] $BASE_PATH/$SERVER_NAME.jar does not exist, skip backup"
    If yes, back it up to the backup directory with time as the suffix
    else
        echo "[backup] Starts backup$SERVER_NAME ..."
        cp $BASE_PATH/$SERVER_NAME.jar $BASE_PATH/backup/$SERVER_NAME-$DATE.jar
        echo "[backup] backup$SERVER_NAMEComplete"
    fi
}
Copy the code

(2) stop

The #stop() method gracefully closes the Java process corresponding to the original JAR package. The code is as follows:

function stop() {
    echo "[stop] starts to stop$BASE_PATH/$SERVER_NAME"
    PID=$(ps -ef | grep $BASE_PATH/$SERVER_NAME | grep -v "grep" | awk '{print $2}')
    Shut down the Java service if it is starting
    if [ -n "$PID" ]; then
        # Normal shutdown
        echo "[stop] $BASE_PATH/$SERVER_NAMERunning, start kill [$PID]. ""
        kill- 15$PID
        Wait a maximum of 60 seconds until shutdown is complete.
        for ((i = 0; i < 60; i++))
            do  
                sleep 1
                PID=$(ps -ef | grep $BASE_PATH/$SERVER_NAME | grep -v "grep" | awk '{print $2}')
                if [ -n "$PID" ]; then
                    echo -e ".\c"
                else
                    echo '[stop] Succeeded in stopping $BASE_PATH/$SERVER_NAME '
                    break
                fi
		    done
        
        If the shutdown fails, force kill -9 to shut it down
        if [ -n "$PID" ]; then
            echo "[stop] $BASE_PATH/$SERVER_NAMEIf no, force kill -9$PID"
            kill9 -$PID
        fi
    If the Java service is not started, there is no need to close it
    else
        echo "[stop] $BASE_PATH/$SERVER_NAMENot started, no need to stop"
    fi
}
Copy the code
  • First, the PID process number corresponding to the Java service is obtained.

  • Then, kill the process first and try to shut down the Java service normally. Given that the shutdown is a process, we need to wait for a while until the Java service is properly shut down.

    Friendly reminder: 60 seconds defined here, if fat friends need shorter or longer, you can modify. Of course, you can also make variables, hey, hey.

  • Finally, if the Java service cannot be shut down, kill -9 to forcibly shut down the Java service.

    Note: If you do not want to forcibly shut down the Java service, you can perform exit 1 here to abnormally exit the deployment, and then manually intervene to troubleshoot the problem.

(3) transfer

The #transfer() method “overwrites” the new JAR from the build directory onto the old jar. The code is as follows:

function transfer() {
    echo "Transfer begins$SERVER_NAME.jar"

    Delete the original jar package
    if [ ! -f "$BASE_PATH/$SERVER_NAME.jar" ]; then
        echo "[transfer] $BASE_PATH/$SERVER_NAME.jar does not exist, skip delete"
    else
        echo "[transfer] removed$BASE_PATH/$SERVER_NAMEThe jar to complete"
        rm $BASE_PATH/$SERVER_NAME.jar
    fi

    Copy the new JAR package
    echo "[transfer] from$SOURCE_PATHTo derive$SERVER_NAME.jar and migrate to$BASE_PATH..."
    cp $SOURCE_PATH/$SERVER_NAME.jar $BASE_PATH

    echo "[transfer]$SERVER_NAMEThe jar to complete"
}
Copy the code
  • Here, we’re not directly covering it becausecpWhen a command is overwritten, the system prompts you whether to overwrite the command. You need to enter the command manuallyyCommand, obviously not enough for our automated deployment needs.

(4) start

The #start() method starts the Java service using the new JAR package. The code is as follows:

function start() {
    Print startup parameters before starting
    echo "[start] Starts$BASE_PATH/$SERVER_NAME"
    echo "[start] JAVA_OPS: $JAVA_OPS"
    echo "[start] JAVA_AGENT: $JAVA_AGENT"
    echo "[start] PROFILES: $PROFILES_ACTIVE"
    
    # start start
    BUILD_ID=dontKillMe nohup java -server $JAVA_OPS $JAVA_AGENT -jar $BASE_PATH/$SERVER_NAME.jar --spring.profiles.active=$PROFILES_ACTIVE &
    echo "[start] started$BASE_PATH/$SERVER_NAMEComplete"
}
Copy the code
  • It’s simple. The key is to passjava -jarCommand, passjarPackage to start the Java service.

(4) healthCheck

The #healthCheck() method checks the URL to determine whether the Java service has been started successfully. The code is as follows:

function healthCheck() {
    If the health check is configured, perform the health check
    if [ -n "$HEALTH_CHECK_URL" ]; then
        Maximum health check is 60 seconds until health check passes
        echo "[healthCheck] is starting to pass$HEALTH_CHECK_URLAddress for a health check.";
        for ((i = 0; i < 60; i++))
            do
                Request health check address, only obtain the status code.
                result=`curl -I -m 10 -o /dev/null -s -w %{http_code} $HEALTH_CHECK_URL || echo "000"`
                # If the status code is 200, the health check is successful
                if [ "$result"= ="200" ]; then
                    echo You have passed the healthCheck.;
                    break
                # If the status code is not 200, the application failed. After sleep 1 second, try again
                else
                    echo -e ".\c"
                    sleep 1
                fi
            done
        
        If the health check fails, the shell script is unexpectedly exited and the deployment does not continue.
        if[!"$result"= ="200" ]; then
            echo "[healthCheck] if the healthCheck fails, the deployment may fail. View logs and determine whether the startup is successful.";
            tail -n 10 nohup.out
            exit 1;
        # Health check passed, print the last 10 lines of log, possible deployment people want to see the log.
        else
            tail -n 10 nohup.out
        fi
    If no health check is configured, slepp 60 seconds to manually check whether the log is successfully deployed.
    else
        echo "[healthCheck] HEALTH_CHECK_URL not configured, start sleep 60 seconds";
        sleep 60
        echo "[healthCheck] Sleep 60 seconds to complete, view the log, determine whether the startup is successful";
        tail -n 50 nohup.out
    fi
}
Copy the code
  • Like the shutdown of a Java service, the startup of a Java service is a process. Here, we provide two strategies: 1) Automatically determine whether the application is successfully started through the health check URL. 2) If the URL of the health check is not configured, we sleep for 60 seconds and then check the log to manually judge whether the startup is successful.
  • The URL for the health check that we provide via Spring Boot ActuatorhealthEndpoint that determines whether the status code returned by the request is 200. If yes, the application is healthy and the startup is complete. If you don’t know Spring Boot, check it outAbstract Spring Boot Monitoring Endpoint Actuator Introductionthe”4. Health Endpoint”Section. For now, fat friends can just know this setting.
  • Of course, in order to meet the fat friend’s “curiosity”, Nai Nai finally printed the N line log to meet the fat friend’s demand to see the start-up log, ha ha ha.

Even though it has 5 steps and less than 200 lines of Shell code, it’s actually quite simple.

2.4 Jenkins deployment task configuration

From the Jenkins home page, click “New Item” button to enter the Jenkins task creation interface. Enter the task name and select build a Maven project. As shown below:

Click ok to go to the task configuration interface. There are many configuration items, as shown in the following figure:

2.4.1 Detailed Configuration

Let’s take a look at the configuration items one by one.

(1) General

  • Relatively simple, just need to configure the description.

② Maven Info Plugin Configuration

  • Discard old Builds Configuration item: Sets reserved builds. Since we’re constantly rebuilding the project, if we don’t set it up, the Jenkins server may run out of disk.
  • This project is parameterizedParametric construction. Here, we use the Git Parameter plug-in to create the Parameter nameBRANCHThe value is the Branch/Tag of the Git project. In this way, we can choose the branch/tag of the Git project to build later in the project build.

③ Source code management

  • Select Git, thus selecting the Git repository.
  • Configuration item: Set up the Git repository to use. Here you can directly use github.com/YunaiV/Spri… The warehouse, Nai – Chi has already prepared the sample project.
  • Branches to Build Configuration item: Set Git Branches/labels used. Here, we use② Maven Info Plugin ConfigurationConfigured build parametersBRANCH

④ Build trigger

  • Do not need to configure for the moment, can ignore ha.

⑤ Build environment

  • Do not need to configure for the moment, can ignore ha.

6. The Pre Steps

  • Do not need to configure for the moment, can ignore ha.

All landowners Build

  • Root POM configuration item: Set the Rootpom.xmlConfiguration file. In general, setpom.xmlCan.
  • Goals and Options: Sets Maven build commands.
    • Here, because we just want to buildlab-41/lab-41-demo01 The child Maven module, so use-pl lab-41/lab-41-demo01Parameters. Other Maven parameters, if you do not know, search ha.
    • If you want to build the entire project, consider using itclean package -Dmaven.test.skip=trueCommand.

Today the Post Steps

  • Do not need to configure for the moment, can ignore ha.

⑧ Build Settings

  • Do not need to configure for the moment, can ignore ha.

⑨ Operation after construction

Click Add Post-Build Artifacts and select Send Build Artifacts over SSH to configure the artifacts to be builtjarPackage is sent to the remote server over SSH and the corresponding script is executed to start the Java service. As shown below:

  • Name: Select the remote server to be deployed. Here, we select the server in “2.3 Remote Server Configuration”.

  • Transfer Set Sources Files Configuration item: Sets the files to be transferred. Jar = lab-41/lab-41-demo01/target/*.jar = lab-41/lab-41-demo01/target/*.jar

    • uselab-41/lab-41-demo01The reason at the beginning is, because what we’re building islab-41/lab-41-demo01 The child Maven module.
    • usetargetThe reason in the middle is that Maven builds results intargetDirectory.
    • use*.jarThe reason at the end is that we only transfer what Maven buildsjarThe package.
    • If fat friends are usedclean install -Dmaven.test.skip=true“Command is usedtarget/*.jarCan.
  • Remove prefix Configuration item: Sets the file to be transferred and the prefix to be removed. Here, we enter lab-41/lab-41-demo01/target/ address, which means that the file name is only *.jar when transferring to remote.

  • Remote Directory configuration item: Directory to be transferred to the Remote server. Here, we enter /work/projects/lab-41-demo01/build, which represents the build directory of the lab-41-Demo01 project transferred to the remote server.

  • Exec Command configures Shell commands to be executed after file transmission. Sh /work/projects/lab-41-demo01/shell &&./deploy.sh to execute the deployment script and start the Java service.

  • Exec in PTY: This parameter must be selected to simulate a terminal execution script. 😎 cough cough cough, if it is not checked, the execution of the command will time out. The specific reason, Nai nai did not find the reason, anyway, so used to finish.

    Note: To display this configuration item, click the “advanced” button on the form.

  • Add Server button: If you want to deploy multiple nodes to more remote servers, you can click to configure it.

After that, click the “advanced” button below and select the option “Fail the build if an error Occurs”. As shown below:

  • With this option, we can mark every deployment of a deployment task as a Failure if a Shell command fails. We will demonstrate this in section 2.4.3 Failed Deployment Examples.

So far, we have completed the configuration of Jenkins deployment task. Click the “Save” button at the bottom to save the configuration. A fun ~

2.4.2 Example of Successful Deployment

Clicking the “Save” button takes you to the details page of the deployment task we configured. As shown below:

Click “Build with Parameters” menu on the left to carry out parametric construction and deployment of the project. As shown below:

Because of ourGithub.com/YunaiV/Spri…The warehouse only has one master branch, so we’re inBRANCHThe parameter has only one choice. Click the “Start Building” button to begin deployment. As shown below:

Click the red circle in Build History to view this Build. After that, click the Console Output menu to see the entire build process, and you’ll see a lot of logs. As shown below:

If the following log is displayed, the deployment is successful. As shown below:

At this point, we return to the Jenkins home page and can see the execution result of the deployment tasksuccessful. As shown below:

2.4.3 Failed Deployment Example

To simulate a failed deployment, modify the deploy.sh script on the remote server and change the health check URL to the following to achieve the result of a failed health check. The code is as follows:

Health check URLHEALTH_CHECK_URL = http://127.0.0.1:8078/actuator/health/1Copy the code
  • As a result, the health check is bound to fail because the modified health check URL does not exist. So,deploy.shThe script will eventuallyexit 1Is an execution error.

After the modification, re-build the deployment task. However, the construction fails. The console output log is as follows:

At this point, we return to the Jenkins home page and can see the execution result of the deployment taskfailure. As shown below:

2.5 summary

At this point, we have completed a configuration study of the Jenkins deployment task. Although said, the whole process may be a little long, and Nai is a long-winded person, but as a “configuration engineer”, two back to cooked.

Since Jenkins is the focus of this article, Java project packaging and so on are not covered. For those of you who are looking forward to Spring Boot’s continued Delivery of Jenkins, Check out this post where Nai nai will share more on how to package Spring Boot and how to better integrate Nginx health checks throughout the deployment process. Must, must, must see it, hahaha.

3. Email notification

Jenkins supports email notification when a build is successful, failed, or Unstable.

Next, we configure the email notification function based on “2. Quick Start”.

3.1 Global Mailbox Configuration

1.From the Jenkins home page, enter the “Configure” screen in the order of “Manage Jenkins -> Configure System”, and then drop down to”Email notification“Position, configurationEmail address from which notifications are sent. As shown below:

2.However, it should be noted that some email services require the user name for SMTP authentication to be the same as the sender email address, for example, 163.com email. So, we pull up to the “Jenkins Location” Location and configureSend a mail. As shown below:

3.After the configuration is complete, click”Email notification“To Test the function of sending email. If the test passes, we’ll see it in the interface"Email was successfully sent"Prompt. At the same time, when we open the received mail, we will see the test mail, as shown below:

🔥 test pass, remember to click “save” button ah!

3.2 Mailbox Configuration for a Deployment Task

On the basis of “2.4 Jenkins Deployment Task Configuration”, we modified the mail configuration. There are two configuration items, let’s take a look at each one.

① Build Settings

  • This is mainly to configure the mailbox notification configuration in case of build failure and build instability. Generally, the configuration is as shown in the figure.

② Operation after construction

Click Add Post-Build steps and select Editable Email Notification to configure the buildsuccessfulEmail notification configuration in this case. As shown below:

  • The Project Recipient List configuration item: Configure the Recipient List, one for each row. 😈 here, we configured a mailbox, heh heh.
  • Other configuration items, we can temporarily not configure, fat friends need, you can configure. Plus, the top one$DEFAULT_RECIPIENTS,$DEFAULT_REPLYTOYou can go to the “Configure” screen in the order of “Manage Jenkins -> Configure System” and then drop down to the”Extended E-mail Notification“To configure. As shown below:
    • Here we don’t use the configuration, use the default configuration, heh heh.

③ Simple test

🔥 test pass, remember to click “save” button ah! You can then do a deployment test to see the effect of mail notifications.

Here is a buildsuccessfulAs shown in the figure below:

Here is a buildfailureAs shown in the figure below:

4. Nail notifications

Jenkins supports configuration of pin notifications to send emails when a build is successful, failed, or Unstable.

Next, we configure the email notification function based on “2. Quick Start”.

4.1 Installing plug-ins

By default, the Jenkins plugin provides pin notificationsDingding Notification PluginIt’s not secure, so we need to install it. The installation steps are simple, and2.2.4 Security other plug-insSection is the same, fat friends to install their own oh. As shown below:

As always, installing plug-ins is slow, so let’s move on.

4.2 Create a group of robots

See section 7.5.5.1 Creating a Pin Swarm Robot in the Impression Prometheus + Grafana + Alertmanager Minimalist Introduction article to create a Pin Swarm robot.

However, it should be noted that Jenkins’ currently configured pin notification mode does not support the ** “encryption” security mode of pin group robots for the time being, so please use the security setting of “IP address (segment)” ** and check your external IP address at IP138.com/.

4.3 Pinning Configuration for deployment Tasks

On the basis of “2.4 Jenkins Deployment Task Configuration”, we modified the pin configuration. Just change one configuration item. Wahaha.

① Operation after construction

Click the “Add Post-Build Steps” button and select the “Pin notifier Configuration” option to configure the buildsuccessfulCase of nail notification configuration. As shown below:

  • Specific choice what option, fat friend can need according to oneself ha.

② Simple test

🔥 after configuration, remember to click “save” button ah! You can then do a deployment test to see the effect of the pin notifications.

Here is a buildsuccessfulAs shown in the figure below:

We currently mainly use pin notifications instead of email notifications.

666. The eggs

Jenkins offers a wide range of features, so you can read the following article:

  • Jenkins Book List
  • Jenkins + Git + Maven + Shell + Tomcat Continuous Integration

Later, Nai will add the following contents, which are also the functions we commonly use in Jenkins:

  • Rights management
  • Jenkins backup
  • Jenkins Pipeline
  • Jenkins Slave Agent