The DeploySite utility is necessary because Visual Studio Publish and dotnet publish are insufficient to deploy a YetaWF site. YetaWF uses symlinks heavily which can't be deployed by other tools.
Deploying to a server using FTP is a two step process. First, the site is backed up locally, including SQL databases, and uploaded. The second step takes place on the server where the site is restored, again using DeploySite. All tools and config settings are uploaded so no tools need to be installed.
A yaml file (named DeploySite.Windows.yaml in this example) is used to define all the deployment attributes. The following is an example of a yaml file used to deploy via FTP to a server. It also backups up the SQL database yetawf which is used by the site. Multiple databases can be defined if necessary.
Databases: - DevDB: yetawf DevServer: localserver DevUsername: theuser DevPassword: thepassword ProdDB: yetawf-production ProdServer: productionserver ProdUsername: theuser ProdPassword: thepassword Deploy: Type: zip To: C:\Temp\Website.zip BaseFolder: C:\Development\YetaWF From: C:\Temp\PublishOutput ConfigParm: Windows.Prod FTP: Server: ftp://yourftpserver Port: 21 User: ftpuser Password: ftppassword Copy: - From: .\DeploySite.Windows.yaml To: /DeploySite.yaml # This is the ZIP file we're uploading - From: C:\Temp\Website.zip To: /Website.zip # The following are required so you can run DeploySite on the server - From: .\PublicTools\DeploySite\Bin\Windows\Softelvdm.DeploySite.exe To: /PublicTools/DeploySite/Bin/Softelvdm.DeploySite.exe Conditional: true - From: .\Restore.bat To: /Restore.bat Site: Location: C:\Sites\YetaWF Zip: C:\Sites\Website.zip
In this example, the root of the FTP server is C:\Sites. This means when we upload file DeploySite.Windows.yaml to /DeploySite.yaml it is saved at C:\Sites\DeploySite.yaml.
For information about available options see the topic DeploySite yaml File.
The first step in deploying a site is to run Visual Studio Publish or dotnet publish. In this example, the solution file is located at C:\Development\YetaWF and the published (partial) site is created at C:\Temp\PublishOutput.
Softelvdm.DeploySite Backup yourfile.yaml
The DeploySite utility takes your partial deployed site (from C:\Temp\PublishOutput merged with C:\Development\YetaWF) and adds all JavaScript, CSS, config files, saving the result as a ZIP file at C:\Temp\Website.zip. Then the FTP,Copy: statements are executed, uploading all necessary files to the server. In this example, the root of the FTP server is C:\Sites. This means when we upload file DeploySite.Windows.yaml to /DeploySite.yaml it is saved at C:\Sites\DeploySite.yaml.
Once everything is uploaded to the server, run the DeploySite utility on the server:
Softelvdm.DeploySite Restore yourfile.yaml
The Site tag in the yaml file is used determine how the site is restored to the server. In this example the ZIP file C:\Sites\Website.zip is unzipped and the site is created in the folder C:\Sites\YetaWF.
The Site tag offers additional options, particularly the ability to run commands before and after creating the site can be useful. It could be used to start/stop IIS application pools, update database permissions, etc. For information about available options see the topic DeploySite yaml File.
Last Updated 11/12/2020 - (email)
© 2023 - Softel vdm, Inc. - YetaWF.com