Service development requirements => Node technology upgrade.

Transition from KOA2 + PM2 to nest+ Dubbo + Docker.

So I tried writing a dobbo+ PM2 auto-deployment shell script

Releases fall into three categories, depending on environment and tool

I. PM2 Deployment (Usually Used)

You can view the running status in the pm2 root directory deploy XXX pm2 list

Ii. Docker deployment (if necessary)

1. Go to Step 1

2. Log in to the server CD and run the do.sh script in the current directory

The script idea

Run the. Sh script (parameters 1. Project name 2. Version 3. Port name) 2. Packaging image

3. Stop pm2 in the sh script

4. Determine whether to delete the container and its name based on the container status

4. Create a container in the sh script and run -p –restart

5. Pm2 daemon running in sh script (test)

3. Publish remote private docker deployment (if necessary)

1. Run the do.sh script in the current directory (parameter 1. Version 3. Port name 4. store) 2. Access remote vault server 3. 4. Pm2 daemon start (test)

It is the first time to write a blog, welcome to put forward suggestions, thank you!