Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy Linux server remotely in Jenkins

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to deploy Linux servers remotely in Jenkins. The quality of the article is high, so Xiaobian shares it with you as a reference. I hope you have a certain understanding of relevant knowledge after reading this article.

plug-in

The plug-in used to operate the remote server locally during remote deployment is publish over ssh

Find Plug-in Management in System Management

Click Plugin Management

Search publish over ssh

The author did not search here because it has been installed

After installation, go back to the system management page just now, pull down to see a system setting, click to enter the system setting page.

Pull down and you will see SSH Servers related configuration

The author is using the password to ssh the server, in the Passphrase to fill in the corresponding password, there are four other contents as follows:

Name is a custom name for sshserver

Hostname is the ssh server address

Username is the username of the ssh server

Remote Directory is a remote directory that needs to upload files to the server

After filling in the basic information, you can click Test Configuration to test whether the connection is normal. After the information is correct, click Apply. An ssh server is configured. The rest is to use the ssh server filled in during project configuration.

Project code pulling, naming, building are skipped here, directly look at the remote deployment part of the project configuration.

First, select Send build artifacts over SSH in Actions after build

Fill in the corresponding remote operation

The above figure shows that the author packs all war packages under the target directory into the webapps/ROOT directory under the remote server tomcat, then decompresses the war package, sleeps for 10S, and executes the restart script.

Here is a detailed explanation:

Source files Files to be packaged

Remove prefix Path of prefix to be removed

Remote directory file uploads the remote server directory, where the directory is relative to the Remote directory previously set up on the remote server

In other words, the directory set by the author here is actually equal to the directory set by the server before/usr/local/apache-tomcat-8.5.37 plus the directory set here/webapps/ROOT, which is/usr/local/apache-tomcat-8.5.37/webapps/ROOT.

Exec command Command executed on a remote server

How to deploy Linux servers remotely in Jenkins is shared here. I hope the above content can help you and learn more. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report