--- tags: AKRR Work --- # VSI Testing Release Procedure ## Table of Contents [TOC] ## Step 1: Figure out what you need to release. Complete the sub-steps for each of the following that apply. * Need to deploy VSI.Core code? * Ensure there is a successful build in DevOPS with the code you wish to release. * Make a note of the build number from DevOPS you need. * Need to deploy changes to VSI.Core ICDJson or CoreProperties.json? * Get the new files together so you can put them instead of the old ones in Step 5. * Need to deploy an updated version of VSI.Sep? * Ensure there is a successful build in DevOPS with the code you wish to release. * Make a note of the build number from DevOPS you need. * Need to deploy a update to VSI.ProcessManager or VSI.ProcessManager.Wrapper? * Ensure the master branch in DevOPS is updated with the code you wish to release. ## Step 2: Setup your build environment. 1. Clone or Pull the latest version of VSI.ProcessManager's master branch into your environment. 2. Ensure you have AKRR DevOPS Setup as a valid nuget package source in Visual Studio. 3. Ensure the current master branch builds in your environment. ## Step 3: Update nuget Dependencies if needed. ***If you are not making changes to the version of VSI.Core or VSI.Sep that are referenced by VSIPM you can skip this step.*** * To update the VSI.Core dependency right click on Dependencies under the VSI.ProcessManager.Wrapper project and select `Manage NuGet Packages...` ![](https://i.imgur.com/MaKpwRF.png) * In the new panel that opens select the `Installed` tab and under that select the `VSI.Core` package. This will open a new panel were you can select the Version you noted earlier from the version drop down and click `Update`. Accept the various prompts and then ensure the project still builds. ![](https://i.imgur.com/McfCvjm.png) * To update the VSI.Sep dependency right click on Dependencies under the VSIPM project and select `Manage NuGet Packages...` ![](https://i.imgur.com/6Z2DMyz.png) * In the new panel that opens select the `Installed` tab and under that select the `VSI.Sep` package. This will open a new panel were you can select the Version you noted earlier from the version drop down and click `Update`. Accept the various prompts and then ensure the project still builds. ![](https://i.imgur.com/qIOwqRj.png) ## Step 4: Build the solution for the destination environment. 1. Select the configuration to build with. At the top of the page drop down solution Configurations and select the configuration you need. (At the moment `PTCLAB` for the PTC Lab and `Test` for IVSD1.) ![](https://i.imgur.com/2CoLMTv.png) 2. Drop down `Build` in the Menu Bar at the top and choose `Rebuild Solution` ![](https://i.imgur.com/8Lo9DE5.png) 3. Down at the bottom in the Output panel ensure the build was successful. ![](https://i.imgur.com/PEeKJ6j.png) ## Step 5: Gather and Deploy Artifacts. ***Note: This is a lot easier with my linux system in the mix to handle the networking but for this guide we will assume that is not an option.*** 1. Ensure you have MobaXterm installed 2. Open MobaXterm and create a new Session And type SSH ![](https://i.imgur.com/IK5s6s8.png) 3. In the `Basic SSH settings` Section enter your remote host where the VSI service is running and specify the username. (For the PTC Lab 192.168.144.108 and root) And in the `Advanced SSH settings` Section ensure the `SSH-browser type` is set to `SFTP protocol`. And Press Ok. ![](https://i.imgur.com/nnvjdXQ.png) 4. Then accept the machine's fingerprint and enter the password for your user. 5. Once it has connected, check with anyone using the environment, and then stop the VSI service using `systemctl stop VSIPM`. And then use `systemctl status VSIPM` to ensure it is no longer running. 6. Using the SSH Browser on the left side of MobaXterm navigate to `/opt/` it usually starts at /root. In /opt/ you should see a folder `VSIPM` that is where the service is installed. ![](https://i.imgur.com/yHctSzE.png) 7. Right Click on that Folder and rename it to some sort of obvious backup name. We will keep the old version around till we have got the files we need from it and we know the new version works. (I have been leaving them there indefinitely in case we need them so far.) ![](https://i.imgur.com/twDWiJj.png) 8. Now use the Create Directory Button to make a new empty folder in `/opt/` called `VSIPM`. Then navigate the SSH Browser into that folder. ![](https://i.imgur.com/EBaQ2EV.png) 9. In Visual Studio in the Solution Explorer right click on the `VSIPM` Project and select `Open Folder in File Explorer` ![](https://i.imgur.com/ncBGZ7H.png) 10. In the explorer window that opens navigate to bin then to PTCLAB or Test depending on the configuration you chose to build it in Step 4 then to netcoreapp3.0 select all the files and drag them into the new `VSIPM` folder in your MobaXterm SSH Browser wait for the files to transfer. ![](https://i.imgur.com/KNccnN3.gif) 11. Once that is done we need to get the last few files that are not tracked properly in Git/Visual Studio Solutions. These are the `ICDJson` folder and `CoreProperties.json` file. If you are looking to update these file use the drag and drop method discussed above to upload the new version. Other wise use the following two commands in the MobaXterm remote terminal to get the files from the backup we made. * `cp -r /opt/<BACKUPDIR>/ICDJson /opt/VSIPM/` * `cp /opt/<BACKUPDIR>/CoreProperties.json /opt/VSIPM/` ## Step 6: Start the new version. 1. Use the following command to run the new version for about 15 seconds and ensure there are no errors and then it will quit so you can run it properly. `cd /opt/VSIPM; timeout 15s dotnet VSIPM.dll` 2. Start the service with `systemctl start VSIPM` and after a few seconds check it is running `systemctl status VSIPM`. ![](https://i.imgur.com/euGAO6Y.png) 3. Then use `tail -f /opt/VSIPM/vsipm_debug.log` to watch the logs for a bit and ensure there are no errors. ## Step 7: Test the deployed system.