xcopy ASP.NET deployment of a Subversion-managed project

前端 未结 4 1921
予麋鹿
予麋鹿 2021-01-13 14:39

I\'m currently using Subversion to manage my ASP.NET website. I\'m finding that whenever I go to upload my website to my server, I\'m copying a large number of hidden .svn f

相关标签:
4条回答
  • 2021-01-13 14:55

    two suggestions:

    • Use robocopy or xcopy to filter out the .svn folders
    • svn export the repository to the webserver (docs). Exporting will not write any .svn folders

    see also: Tortoise SVN hidden SVN folders

    0 讨论(0)
  • 2021-01-13 15:03

    I have a postbuild step, which prepares a clean drop folder as part of the project build. Here's how I do it:

      <PropertyGroup>
        <DropPath>..\..\drop\</DropPath>
        <TestDropPath>..\..\test\</TestDropPath>
      </PropertyGroup>
      <Target Name="AfterBuild">
        <ItemGroup>
          <Binaries Include="$(OutputPath)**\*.*" />
        </ItemGroup>
        <ConvertToAbsolutePath Paths="$(DropPath)">
          <Output TaskParameter="AbsolutePaths" ItemName="FullDropPath" />
        </ConvertToAbsolutePath>
        <Message Importance="High" Text="Binplacing -&gt; @(FullDropPath)" />
        <Copy SourceFiles="@(Compile)" DestinationFiles="@(Compile->'$(DropPath)%(Identity)')" />
        <Copy SourceFiles="@(Content)" DestinationFiles="@(Content->'$(DropPath)%(Identity)')" />
        <Copy SourceFiles="@(EntityDeploy)" DestinationFiles="@(EntityDeploy->'$(DropPath)%(Identity)')" />
        <Copy SourceFiles="@(Binaries)" DestinationFiles="@(Binaries->'$(DropPath)%(Identity)')" />
      </Target>
    

    Of course, svn export works as well. :-) However, with that approach you can't modify and commit back to the repository any source file modified during the build.

    0 讨论(0)
  • 2021-01-13 15:06

    How about you run Subversion on the server and then do an svn export from the repository? svn export is like a checkout, but w/o the .svn folders (and w/o the ability to do Subversion work in that directory).

    Alternately, do a svn export of the repo on your local machine and then FTP up the exported version.

    0 讨论(0)
  • 2021-01-13 15:18
    1. You should use export command of the subversion.
    2. You may tweak registry and add a "Delete SVN Folders" to the context menu for folders. Here is an example script from http://weblogs.asp.net/jgalloway/archive/2007/02/24/shell-command-remove-svn-folders.aspx Save it to a .reg file and execute.

    Right click on your project folder and delete all .svn folders recursively.

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
    @="Delete SVN Folders"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
    @="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""
    
    0 讨论(0)
提交回复
热议问题