TFS Service 2012 Build Process Template (XAML Workflow) with FTP Publishing (Deployment) - tfs

I have web site project hosted at TFS Cloud. And I have hosting account at Godaddy, which allows me to deploy sites via FTP only.
I create publishing profile in Visual Studio 2012 and can successfully execute publishing to FTP in Visual Studio.
The problem:
This the task cannot be done using any standard TFS Build template and neither its standard workflow activities, even though it should be a trivial thing people do with TFS Build server. There is no ready "copy-paste" solution (wpp.targets) on MSBuild for that:
"C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Deploy\Microsoft.Web.Publishing.Deploy.FTP.targets"
Clearly says that it is not supported through the command line, one should use VS for that.
Question:
Is there any implemented solutions of that task that I can just copy paste to my team project with few clicks?
I expected to see lots of articles about it in web, however I didn't find any simple existing solution. Articles like this require me to install some 3rd party software (which is not an option in most popular hosting like Godaddy), and it's not clear how to use it with TFS.

In the default Build template, go to the process section and choose Msbuild Arguments and give the publishing profile.
MSBuild Arguments : /p:DebugSymbols=false;DebugType=None;DeployOnBuild=true;PublishProfile=YourProfileName
when Build got succeeded, it will be deployed to the ftp location.
this link may help you more : http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx

Related

Build and Deploy a Web Application with TFS 2015 Build

We have just installed TFS 2015 (Update 1) on-premise and are trying to create a Continuous Integration/Build system using the new TFS Build system. The build works fine, and gives me a green light, but when I look at the default build it has only built the binaries from the bin directory, and there seems to be no easy way to deploy the app on-premise to a local server.
There are two deploy options for a filesystem copy, and a powershell script, and it would certainly be easy enough to use them to copy files to a new server, but since the build only built the binaries, I don't see a tool to gather up the Web artifacts (cshtml, images, scripts, css, etc..) for this.
After an exhaustive google search, I've only found one article which talks about this at:
http://www.deliveron.com/blog/building-websites-team-foundation-build-2015/
However, this uses WebDeploy and creates a rather messy deploy package.
How can I deploy the site (standard MVC web application, in fact my tests are using the default boilerplate site created by the create project wizard) complete with artifacts to a local server in the easiest possible way? I don't want to have to install WebDeploy on the servers, and would rather use PowerShell or something to deploy the final artifacts.
The build is just the standard Visual Studio build template, with 4 steps (Build, Test, Index & Publish, Publish Build Artifacts).
We use "Visual Studio Build" step and as Arguments for MSBuild we use following line:
/p:DeployOnBuild=True /p:PublishProfile=$(DeploymentConfiguration)
On Variables tab page DeploymentConfiguration has to be configured. It must be the Name of the publish Profile (filename of the pubxml file). If the file Name is Build.pubxml the publish profile is Build.
for example:
/p:DeployOnBuild=True /p:PublishProfile=Build
I wanted to add that Ben Day has an excellent write-up that helped us package quickly and then release to multiple environments through Release Manager.
His msbuild arguments look like this:
/p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=$(build.artifactstagingdirectory)\for-deploy\website
The difference between this and the accepted answer is that this parameter set stages everything in an artifacts folder, and then saves it as part of the build. We can then deploy exactly the same code repeatedly.
We capture the web.env.config files alongside the for-deploy folder and then use xdt transforms in the release process to ensure everything gets updated for whichever environment we're deploying to. It works well for all our web projects.
We use WebDeploy/MSDeploy for 40+ applications and love it. We do install WebDeploy on all our servers so we can deploy more easily but you could also use the Web Deploy On Demand feature which doesn't require WebDeploy be pre-installed.

How to automate the download and installation of Sitecore update packages generated from TFS build?

I am developing a Sitecore solution locally using TDS. Our source control and build server is Visual Studio Team Services (in the cloud). I would like to figure out a way to implement Continuous Integration and get builds to be automatically installed on an Integration server that is an Amazon VM (or it could be some other externally located server). I have the TDS build configuration set up to create a Sitecore Update Package. The build process works great. At the end of the build process I have the Sitecore Update Package sitting in a Drops folder in source control (TFS in the cloud). Now I can't figure out how to automate the process of getting that update package out of source control and downloading it to the Integration server and running the Sitecore command to install it.
In a perfect world you would use something along the lines of a fancy Microsoft Release Management to deploy it to the environment of choice. However, if you are like the majority of us mere mortals without the fancy tools - this should help: https://github.com/adoprog/Sitecore-Deployment-Helpers
With these pages you could just send a get request from TFS or use the logic to write a custom PowerShell post-build script. Hope this helps!
As you are using TFS you get to use Release Management for Visual Studio out of the box. This is a simple install but at this time is separate. I have an instance of RM running in a VM and attached to my VSO instance for running deployments.
I would expect this tool, which was bought by MS last year, would become more integrated in vNext.

TFS - automate deployments for IIS and SQL Server using Migrator.net

I am attempting to automate my process for deployments.
Currently, the following steps need run:
Run an external tool in Visual Studio to call Migrator.net (using MSBUILD) to update the database
Right-click the web project and publish locally
Copy the publish folder to all web servers for that specific website
I have now been looking at how to deploy directly from Visual Studio Team Services.
I have created a build definition that will compile my code, and using MSBuild arguments in the "Process" tab of the build definition, will use a publish profile to publish directly to IIS on a target machine. The arguments are something like this:
/p:DeployOnBuild=true;PublishProfile="test_publish.pubxml";UserName=xxx;Password=xxx
This works like a charm for the actual web content, but it does not deal with the database side of things.
The external tool to update the database, as I mentioned, calls MSBUILD with the following:
$(ProjectDir)\Migrations.proj /target:MigrateUAT /p:To=-1 /p:password=xxx
How would I change the build definition to also deal with this MSBuild call? I am at the limit of my MSBuild knowledge.
Thanks in advance.
I have not found out how to do this directly. So I am taking the approach to write a large MSBUILD script that will do everything I want, and only use Team Services to call this script. Rather than use the work flow stuff within the build definition.

What am I doing wrong - problems building using TFS 2012

I am trying to get the most basic configuration of TFS 2012 up and running.
So far I installed the TFS server using the simplest option (the 1st option in the installer - the one that comes with a bundled SQL express),
I configured the build service (1 controller, 1 agent, both on the TFS machine).
My project consists of 2 parts: a C#/silverlight part, and a C++ part.
After adding the silverlight prerequisites the C# project builds correctly.
However I can't get the C++ project to build.
I guess I am missing a prerequisite since I am getting the following errors:
C:\Builds\1\proj1\Client\src\Code\Client\proj\main (VC11).vcxproj
(19): The imported project "C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\v110\Microsoft.Cpp.Default.props" was
not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
Indeed, the TFS server does not have a "C:\Program Files (x86)\MSBuild\Microsoft.Cpp" folder (while my dev machine has one).
I installed the windows SDK, but that didn't help.
I saw on some posts that I need to install VS 2012 on the build machine. Is that correct? will VS express do?
I have been banging my head on this for the last 2 days, and any help would be appreciated.
Installing Visual Studio on your build server seems like a strange thing to do, but having been around the TFS block a bit, I have found it to be the simplest way to manage build servers.
You can copy the files manually from your dev machine to your build server, but if an update to visual studio comes out, you will need to figure out what has changed and make sure you update all those files too. These files typically include Targets files and associated dlls.
Also with all the extensions and packages that are available now, it is just easier to load Visual Studio on your build server and install the required packages than try to work out what is needed to replicate the functionality.
This was made very clear to me recently when Microsoft released ASP.Net and Web Tools 2012.2. This altered the publishing pipeline for Web Sites and Web Projects and I needed to use this in my TFS build. It was so much easier to just be able to log onto my build server, load Visual Studio and download the new update.
I would definitely support installing Visual Studio on your build server.

TFS 2010 Build ClickOnce deployment files

My application consists of a Server and Client. Each of our customers has a PC that will host the server and a clickonce deployment of the client that they can then install on whatever PCs they want to have it. I am currently trying to find out the best way to handle this since the support for publishing clickonce installers from TFS Build seems to be nonexistent.
The publish URL for each customer will be different so I would like to have a separate build for each customer that just reuses the binaries built for the server and client.
My ideal solution would be having a team project for the code (Server and Client) and then a separate team project with folders for each customer. The Customers Team Project would also house the binaries from the builds of the Server and Client. Then I would create a build for each customer that would change the publish url of the client clickonce .application file and re-sign it.
The biggest place I am stuck right now is how to get the clickonce publish files from Team Build, but I am also curious if there is just a totally better way to do this that I have missed.
Thanks
See "Building ClickOnce Applications from the Command Line [MSDN]"
I think you could set up a MSBuild workflow activity in Team Foundation Build to publish each of your customer's projects, if you're using the default Workflow template.

Resources