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.
-
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.
-
After successfully logging in, click the upper left view drop-down to select the workbench to enter the workbench.
-
Select Web Terminal
-
Click on the left menu bardefalut, here use Project Development EnvironmentMake an example
-
Click to log inA certain project development environment, (defaultwebcli The account that automatically logs in iszfs-userAfter the connection is successful
-
After the connection is successful, enter the command:
cd /work
-
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.
-
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.
-
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
-
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
-
Then enter the "ls" command, you can see that there is an additional compression in the current folder package
-
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/
-
Open the bastion host interfaceFile Management to download.
-
Find the file directory and right-click to download the compressed package to your local computer.
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.
- 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
Or enter via the following methods
-
Click the arrow on the right and upload the compressed package to the /work directory
-
Click the upload button and select the compressed package just transferred
-
After the upload is successful, you can see that there is an additional compressed package in the current folder.
-
Enter the **/work** directory on the left command line
cd /work
-
Usage instruction备份Duezte-vue文品夹(
If it happens)mv zte-vue20230606 ./zte-vue
-
Use the command againDecompressthe compressed file just uploaded
tar zxvf zte-vue_20230606.tar.gz
-
After successful decompression, the zte-vue folder has been deployed.
-
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.