Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks for both your answers. I fixed everything now, struggled alot with including a build and migration for my database (migrator.net) but I cheated and did it through the runcommand instead.</p> <p>I thought I post my whole deployment process here so people who read this post might learn from all my misstakes. The basic steps are:</p> <ul> <li>Web.config transforms to make sure all settings are correct for each of the clients</li> <li>Backup of webserver files and database at the production server</li> <li>Exclude all gfx directories for all clients</li> <li>Include the gfx dir which is wanted by this client</li> <li>Include extra binares and license-files which are not referenced by the project correclty</li> <li>Migrate the database to the current revision</li> <li>Webdeploy all the new files</li> </ul> <p>Deploy.proj, imported by <code>&lt;Import Project="Deploy.csproj" /&gt;</code> at the last line of the webproject project file:</p> <pre><code>&lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; &lt;PropertyGroup&gt; &lt;CopyAllFilesToSingleFolderForPackageDependsOn&gt; ExcludeAllGfx; Client1Backup; Client1Include; Client1Migrate; CollectBinFiles; $(CopyAllFilesToSingleFolderForPackageDependsOn); &lt;/CopyAllFilesToSingleFolderForPackageDependsOn&gt; &lt;/PropertyGroup&gt; &lt;Target Name="ExcludeAllGfx" BeforeTargets="ExcludeFilesFromPackage"&gt; &lt;ItemGroup&gt; &lt;ExcludeFromPackageFiles Include="gfx\client1\**\*.*"&gt; &lt;FromTarget&gt;Project&lt;/FromTarget&gt; &lt;/ExcludeFromPackageFiles&gt; &lt;ExcludeFromPackageFiles Include="gfx\client2\**\*.*"&gt; &lt;FromTarget&gt;Project&lt;/FromTarget&gt; &lt;/ExcludeFromPackageFiles&gt; &lt;ExcludeFromPackageFiles Include="gfx\client3\**\*.*"&gt; &lt;FromTarget&gt;Project&lt;/FromTarget&gt; &lt;/ExcludeFromPackageFiles&gt; &lt;/ItemGroup&gt; &lt;Message Text="ExcludeFromPackageFiles: @(ExcludeFromPackageFiles)" Importance="high" /&gt; &lt;/Target&gt; &lt;Target Name="CollectBinFiles"&gt; &lt;ItemGroup&gt; &lt;_CustomFiles Include="..\IncludeBin\Telerik\Telerik.ReportViewer.WebForms.dll" /&gt; &lt;_CustomFiles Include="..\IncludeBin\Telerik\Telerik.Reporting.dll" /&gt; &lt;FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"&gt; &lt;DestinationRelativePath&gt;Bin\%(Filename)%(Extension)&lt;/DestinationRelativePath&gt; &lt;/FilesForPackagingFromProject&gt; &lt;/ItemGroup&gt; &lt;/Target&gt; &lt;Target Name="Client1Migrate" Condition="'$(Configuration)|$(Platform)' == 'Release Client1|AnyCPU'"&gt; &lt;Exec Command="&amp;quot;..\MigratorProject\Bats\Client1.bat&amp;quot;" ContinueOnError="false" /&gt; &lt;/Target&gt; &lt;Target Name="Client1Include" Condition="'$(Configuration)|$(Platform)' == 'Release Client1|AnyCPU'"&gt; &lt;ItemGroup&gt; &lt;_CustomFilesClient1 Include="gfx\Client1\**\*.*" Exclude="gfx\Client1\**\.svn\**\*.*"&gt; &lt;FromTarget&gt;Project&lt;/FromTarget&gt; &lt;/_CustomFilesClient1&gt; &lt;FilesForPackagingFromProject Include="%(_CustomFilesClient1.Identity)"&gt; &lt;DestinationRelativePath&gt;gfx\client1\%(RecursiveDir)%(Filename)%(Extension)&lt;/DestinationRelativePath&gt; &lt;/FilesForPackagingFromProject&gt; &lt;/ItemGroup&gt; &lt;/Target&gt; &lt;Target Name="Client1Backup" Condition="'$(Configuration)|$(Platform)' == 'Release Client1|AnyCPU'"&gt; &lt;Exec Command="&amp;quot;C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe&amp;quot; -verb:sync -source:contentPath=&amp;quot;page of client1&amp;quot;,computerName=http://10.8.1.1/MsDeployAgentService2,encryptPassword=pass -dest:package=c:\Backups\deployments\client1.zip,computerName=http://10.8.1.1/MsDeployAgentService2,encryptPassword=pass" ContinueOnError="false" /&gt; &lt;Exec Command="&amp;quot;C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe&amp;quot; -verb:sync -source:runCommand='C:\Backups\deployments\scripts\backup.cmd client1',waitInterval=20000 -dest:auto,computerName=http://10.8.1.1/MsDeployAgentService2,encryptPassword=pass" ContinueOnError="false" /&gt; &lt;/Target&gt; &lt;/Project&gt; </code></pre> <p></p> <p>Backup.cmd:</p> <pre><code>@echo off sqlcmd -v name=%1 -S . -i "C:\Backups\deployments\scripts\backupdb.sql" C:\Backups\deployments\scripts\stampme "C:\Backups\deployments\%1.zip" </code></pre> <p>backupdb.sql:</p> <pre><code>DECLARE @name NVARCHAR(50) -- database name DECLARE @path NVARCHAR(256) -- path for backup files DECLARE @fileName NVARCHAR(256) -- filename for backup DECLARE @fileDate NVARCHAR(20) -- used for file name SET @name = '$(name)' SET @path = 'C:\Backups\deployments\' SELECT @fileDate = REPLACE(REPLACE(CONVERT(VARCHAR(50),GETDATE(),120),':','-'), ' ', '@') SET @fileName = @path + @name + '_' + @fileDate + '.BAK' BACKUP DATABASE @name TO DISK = @fileName; </code></pre> <p>stampme.bat: <a href="http://ss64.com/nt/syntax-stampme.html" rel="noreferrer">http://ss64.com/nt/syntax-stampme.html</a></p> <p>Hope anyone gets some help and examples from this entry.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload