current position:Home>[front end basics] Linux command: Project Automation deployment

[front end basics] Linux command: Project Automation deployment

2022-04-29 10:51:44@Dai

Linux command : Project automation deployment

One 、 meaning

Automated deployment means that developers can package and deploy projects with simple operations , It is more convenient and faster than the traditional way before . There are also many automated tools on the market , But this article is about creating sh file , adopt Linux Command to deploy .

Two 、 step

First step : Compress packaged items

 Insert picture description here

The second step : establish deploy.sh file , adopt Linux The command sends the packed compressed package to the server
 Insert picture description here

scp dist/dist.zip [email protected]:/tmp/dist.zip # Copy the compressed package to the specified directory of the server 
&& ssh [email protected]

The third step : function deploy.sh file
 Insert picture description here

start deploy.sh

Step four : Input password
 Insert picture description here
Then the compressed package will be sent to the specified directory of the server , The next step is to unzip the compressed package to the specified directory on the server .

Step five : Create one under the server instruction directory sh file , And enter the command

touch deploy.sh
vim deploy.sh

i Indicates the input content

rm -rf /www/wwwroot/http/* && unzip -o /tmp/train3d.zip -d /www/wwwroot/http/

Press esc , Input :wq Means save and exit

Step six : Running the server deploy.sh file

sh deploy.sh

In the future, the deployment process of this project only needs to run two files to realize the deployment :
1、 Run local deploy.sh
2、 Running the server deploy.sh

Be accomplished !!

The above is the content of project automation deployment , Welcome to your attention 《 Front end Basics 》 special column .
I'll take myself as usual Common problems in projects as well as Written interview Knowledge in CSDN Share with you , Progress together , come on. .

copyright notice
author[@Dai],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204290905329324.html

Random recommended