Webmatrix - deploying only certain files - webmatrix

I have a project I'm deploying using WebMatrix. Is there a way to exclude certain files from the deployment e.g. perhaps some text files I may have in my project's directories?

When you use Webmatrix deployment mechanism it will show you what files it is going to deploy.
Simply uncheck the files you don't want to deploy.

Related

Perfered method for removing Roslyn folder from Octopus deploy nuget package

I've noticed that octopack is including the Roslyn folder under the bin folder for my web deployment. What would be the preferred method for excluding this from the build without affecting development. I considered a post build event in only the "release" solution config to delete it but wondered if there was a better way (and it doesn't need to be specific to octopus).
This folder is added by the Microsoft.CodeDom.Providers.DotNetCompilerPlatform nuget package. If you want C#6 support in Asp.Net (.cshtml or .aspx) files it needs to be there, because the roslyn's csc.exe from that folder is used to compile your views.
In order to be able to remove it (not deploy it), you'd need to precompile your web application with aspnet_compiler.exe

TFS 2013 Web Deploy and web API help pages

I am using Team Foundation Server 2013 and have the nightly build configured to deploy a web application. The web application is making use of the web API help pages which depend on the built in XML documentation files.
I currently have these XML files being output to the App_Data folder. These are not being copied to the server during deployment. I tried checking in the documentation files but when the build process tried to regenerate them it caused an access error as the files are read-only.
I currently have a placeholder text file inside the App_Data folder included in the project to ensure that the folder gets created but I have to manually copy across the documentation files in order for the help pages to work as intended.
What is the correct/best way of forcing these files to be copied?
Thanks
Ensure the project build order has the docs being built first. Right click on the solution and choose Project Build Order
Then add some MSBuild logic in your pubxml or wpp.targets file to add the generated help files to the FilesForPackagingFromProject ItemGroup.
http://sedodream.com/2012/10/09/VSWebPublishHowToIncludeFilesOutsideOfTheProjectToBePublished.aspx
Open the solution, right click on the .xml file, click Properties, for 'Copy to Output Directory' select 'Copy Always'.

Parameters.xml - what is the best way to include many of them?

We have a couple of environments where we want to deploy our webapp to. We would like to include a range of setparameters.xml files in our project and when we execute the web publishing pipeline (wpp) we want those be copied over to the destionation folder. What would be the additions we need to include in wpp.targets?
We are using Visual Studio 2013 / 2015.
No changes are required in the wpp.targets file. We have 4-7 different SetParameters.[env].xml files for most of our products. We keep this in the root of the web application project.
We use the -setParamFile flag to set the necessary parameter file for the right environment when we execute the *.deploy.cmd file. We use Thoughtworks GO! to trigger the deployment but you can use any release orchestration product or just the commandline.

Deploying umbraco with TeamCity

First post on Stack, so please be gentle!
We are just getting into Continuous Integration with TeamCity. We have setup a TeamCity project(s) that looks like so:
Solution Build (builds entire solution) - .Sln file
Debug to Dev Server (builds .csproj in Debug configuration and Deploys to test server using MSDeploy)
Release to Production (builds .csproj in Release configuration and Deploys to production server using MSDeploy)
Within our Umbraco Visual Studio project (which is a Web Application not the standard Website project type) we have the umbraco_client and umbraco folders excluded from the Project, primarily because they are already compiled and don't need to be re-compiled by our process. Both folders are however included in the SVN repo.
The problem we are experiencing is that because these two folders are excluded from the Visual Studio project, TeamCity does not deploy them.
So my question boils down to "how do you include folders in the TeamCity build package where the folders are in the SVN but excluded from the Visual Studio project?".
Any pointers would be really appreciated.
Thanks
dotdev
We've been using TeamCity for umbraco. This is what we've been doing recently on our internal dev servers:
/p:Configuration=Debug
/p:DeployOnBuild=True
/p:DeployTarget=MSDeployPublish
/p:MsDeployServiceUrl=OurDevServer/msdeployagentservice
/p:AllowUntrustedCertificate=True
/p:MSDeployPublishMethod=RemoteAgent
/p:CreatePackageOnPublish=True
/p:DeployIisAppPath=umbraco_site
/p:IgnoreDeployManagedRuntimeVersion=True
/p:FilesToIncludeForPublish=AllFilesInProjectFolder
/p:SkipExtraFilesOnServer=True
/p:ExcludeFoldersFromDeployment="media;App_Data\Logs;App_Data\preview"
/p:IncludeSetAclProviderOnDestination=False
/p:AuthType=NTML /p:UserName=
They key to solving the problem you are having is
/p:FilesToIncludeForPublish=AllFilesInProjectFolder
By default, it is set to something like "AllFilesInProject". Combining FilesToIncludeForPublish with the ExcludeFoldersFromDeployment can give you some control over exactly what TeamCity attempts to deploy
I would suggest using an approach similar to the one described in this blog post: http://blog.iqit.dk/2013/11/using-package-restore-in-umbraco-projects
You don't mention nuget, so assuming you use a zip or web pi to setup Umbraco in your solution, but you should still be able to use the targets listed in msbuild or add to your web applications .csproj when building your solution. It would require that you have the Umbraco and Umbraco_client folders somewhere in Svn repo or on your build server in order to copy it in.
As an alternative I can also recommend that you download the UmbracoCms nuget as that contains an extension to the msdeploy pipeline that includes the two mentioned folders in an msdeploy zip package. But again also based on the nuget install and thus a standard location for the Umbraco folders.
Hope this helps.
I've based my TeamCity builds on Troy Hunt's excellent "You're Deploying it Wrong" series - which is an excellent step by step guide to integrating Visual Studio based projects and TeamCity. http://www.troyhunt.com/2010/11/you-deploying-it-wrong-teamcity.html
As to excluding the umbraco and umbraco_client folders from SVN; a complex Umbraco build will probably have changes in the Umbraco folder to the default build eg adding Umbraco Event Handlers, adding new Umbraco Sections, changes to back-office tabs. I don't think umbraco_client will change unless you get into changing rich text editors and so on - but it is possible. So I'm not sure that excluding those particular folders is correct. Excluding the media folder is often discussed as well - but it does make TeamCity config simpler if everything is there.
But to answer your question you could exclude them from the build and copy them onto your build server; then add a 'Command Line' runner build step that simply copies them back into place before the build step starts.
I usually add a source control change step that fires a rebuild and have two build steps in TeamCity for an Umbraco project. One is a 'Visual Studio (sln)' runner to check that the sln file has every reference and third party product set up correctly (this should eliminate the 'it works on my machine' issues); and the second is a 'MSBuild' runner that replicates the csproj build process. With the second build step with the right permissions (if your ports are open on the machine you're deploying to, or you're deploying to the same machine as you are on) you could test this in Visual Studio or DOS.
These two build steps should be able to deploy to the IIS website on a staging server; and if the right ports are open on your live or UAT server you could then add a third build step and deploy it onwards (if the first two build steps run properly).

Recommended file setup for VisualSVN and Web Deployment Projects

Our ASP.NET web shop is starting to move from VisualSourceSafe to Subversion (VisualSVN/TortoiseSVN).
Subversion needs to have all files residing in a single directory tree. This is simple when using a Web Application Projects - everything lives in
\Visual Studio 2008\Projects\MyProject
With a Web Deployment Project, though, it's a bit of a mess. You have
\Visual Studio 2008\Website\MyProject for the website itself
\Visual Studio 2008\Projects\MyProject for the solution file
\Visual Studio 2008\Projects\MyProject\MyProject_deploy containing a complete "deployment" version of the website
What's the best practice for managing this in SVN? Should I just move the website under \Visual Studio 2008\Projects\MyProject and add the whole thing to the repository, including the deployment version of the site?
Best practice is to leave your solution file at the root of your project structure, with every project in a sub-folder. That way, each project can be checked out individually without the solution file if people wish to do so.
So in your case, you should have, in your SVN repository, something like:
svn://{repository_root}/MyProject/Website/ {all website files including the .proj file}
svn://{repository_root}/MyProject/WebsiteDeployment/ { all deployment files including .proj file}
svn://{repository_root}/MyProject/MyProject.sln
So the answer to your question is yes, you should move everything under a folder called "MyProject".
Edit: you should also consider having MyProject/Trunk, MyProject/Tags, and MyProject/Branches, which is considered best practice according to the SVN Manual.

Resources