The process of outsourcing the front-end project development environment to UAT/SIT/production (bastion machine)

This tutorial comes from @李文college, distributed on behalf of

1. Compression code

Use the following steps to compress the package that has been built in Jenkins.

  1. Log in to the bastion machine and enter the development environment server. If you have not registered an account yet, please register an account first or contact operation and maintenance.

  2. After successfully logging in, click the upper left view drop-down to select the workbench to enter the workbench.image.png

  3. Select Web Terminal

    image.png

  4. Click on the left menu bardefalut, here use Project Development EnvironmentMake an example

    image.png

  5. Click to log inA certain project development environment, (defaultwebcli The account that automatically logs in iszfs-userAfter the connection is successful

    image.png

  6. After the connection is successful, enter the command:

    cd /work
    
  7. Enter the /work directory, and then you can check whether there is azte-vue folder in the current directory (the front-end packages are all here), Enter the "ls" command to view the files in the current folder.

    image.png

  8. The packages of each front-endmicroservice are placed inzte-vue folder, this time, copy the entire zte-vue file of the development environment to the uat environment as an example.

  9. Before copying the directory, an administrator with high authority is required. You can use the following command to switch to the root account.

    sudo su - root
    
  10. Compress the currentzte-vue folder into gz format (zip is acceptable)< /span> to distinguish it. Enter commanddateCompress the package and bring the

    tar zcvf zte-vue_20230606.tar.gz ./zte-vue
    
  11. Then enter the "ls" command, you can see that there is an additional compression in the current folder packageimage.png

  12. Copy the compressed package to the/home/zfs-user/app-jar directory (operation and maintenance has set permissions, home directory before downloading).

    /bin/cp -rf /work/zte-vue_20230606.tar.gz /home/zfs-user/app-jar/
    
  13. Open the bastion host interfaceFile Management to download. image.png

  14. Find the file directory and right-click to download the compressed package to your local computer.
    image.png

2. Deploy code

The code is mainly deployed in UAT/SIT/production and other environments. This operation is demonstrated on the treasury UAT environment bastion machine.

  1. Log in to the UAT environment operation and maintenance terminal, find the host that needs to send the package "10.190.219.19" and click to log in

image.png

Or enter via the following methods
image.png

  1. Click the arrow on the right and upload the compressed package to the /work directory
    image.png

  2. Click the upload button and select the compressed package just transferred
    image.png

  3. After the upload is successful, you can see that there is an additional compressed package in the current folder.
    image.png

  4. Enter the **/work** directory on the left command line

    cd /work
    
  5. Usage instruction备份Duezte-vue文品夹(If it happens)

    mv zte-vue20230606 ./zte-vue
    
  6. Use the command againDecompressthe compressed file just uploaded

    tar zxvf zte-vue_20230606.tar.gz
    
  7. After successful decompression, the zte-vue folder has been deployed.

  8. Finally, don’t forget to delete the compressed file package you just uploaded. At this point, the uat front-end package has been replaced by the development package.

    image.png

Guess you like

Origin blog.csdn.net/m0_37680500/article/details/131390633