Deploying To A Server (FTP)
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.
Prepare Yaml File
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.
- DevDB: yetawf
- From: .\DeploySite.Windows.yaml
# This is the ZIP file we're uploading
- From: C:\Temp\Website.zip
# The following are required so you can run DeploySite on the server
- From: .\PublicTools\DeploySite\Bin\Windows\Softelvdm.DeploySite.exe
- From: .\Restore.bat
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.
Run Visual Studio Publish or dotnet publish
ASP.NET Core only: 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. This step is not necessary when using ASP.NET.
Run DeploySite (Locally)
Softelvdm.DeploySite Backup yourfile.yaml
Run DeploySite (Server)
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.