How to deploy an html website without a solution/project file - tfs

I'm running TFS 2012 with a build to deploy an asp.net application but now I'm trying to create a build to deploy an html site, that's our html mockups folder. The developer is using eclipse and is able to check in his changes to TFS. It's simply a number of html pages that we want to publish to the QA server on check in.
When setting the build, I have to enter the "Items to build" but I don't have a solution/project to build.
Thanks

How would you deploy it manually? If it's a simple file copy you can customize your build workflow to do that. Alternatively, you could create a MSBuild file (.build) that did it, check the build script in, and point to that for your Items To Build.

Related

TFS Build: How to get EXE file deployed to website

I have a TFS Build Definition that builds/deploys a web project to our internal IIS server. That works fine. However, I would also like to build/deploy a WinForms app (.exe) to the same web site.
I did add the WinForms solution to the Build Definition. TFS builds the .exe and copies it to the drops folder. But it's not in the _PublishedWebsites folder.
I've been manually copying the file over to the web site. Is there a way to automate this?
Thanks in advance!
In XAML build, you can check in your script, and specify a post-build script path in your XAML build definition. This script gathers some of the typical binary types from the typical locations and copies them to the folder from which TFBuild copies and drops to your staging location. Check more information about Run a script in your XAML build process at website: https://msdn.microsoft.com/library/dn376353%28v=vs.120%29.aspx
If you upgrade to TFS 2015, in the new build system, you can simply add a PublishBuildArtifacts task in your build definition. About how to use this task, check: https://www.visualstudio.com/en-us/docs/build/steps/utility/publish-build-artifacts

VSTS Build Not Dropping All Files for Web Application

When I started writing this question, my problem was that after a successful VSTS Build, I wasn't able to see the files relating to my web application project for release. Only the files from certain other projects in the solution were present. However, I just came across this question, which has helped.
I can now see the compiled .dll files for my web application project, after altering the configuration of the Content setting in the Build - that is, the contents of the Bin folder under that project. But I can't see anywhere the other files I need to copy the built web application to my server - the views, the scripts, the css, etc.
I'm finding the power and flexibility of VSTS's Build and Release functionality very confusing as it's complete overkill for our requirements. Up until now, I've just right-clicked on the web app project in Visual Studio selected Publish and used the File System publish method. Easy. Now that I want to automate the building and deploying of the application, it's many times more complicated!
So, can anybody tell me how I can get the solution to build in VSTS in such a way that I can then use a Copy Files task in the Release Definition to copy the files to our web server (the server isn't visible to the Internet so I'm using a locally-hosted Agent)?
In vNext build, to publish your build artifacts with the Copy files or Publish build artifacts steps. Try to use the local path on the agent where any artifacts are copied to before being pushed to their destination. For example:
Add /p:DeployOnBuild=true
/p:OutDir="$(build.artifactstagingdirectory)\" arguments in Visual
Studio Build step;
Change "Path to Publish" of Publish Build Artifacts task to
$(build.artifactstagingdirectory)\_PublishedWebsites\ProjectName:
Details please check the screenshot of build step with this question: How do I get the the expected output from a TFS 2015 build (to match my XAML build)?
Base on your comments, you have published the web app from Visual Studio. Usually, this action will generate a publish profile under Project/Properties/PublishProfiles folder. The settings you used to publish the web app is stored in the profile. So you just need to make sure this publish profile is checked into source control. And then in the TFS build, add following MSBuild arguments:
/p:DeployOnBuild=true /p:PublishProfile="publishprofile.pubxml"

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.

ClickOnce through TFS & Release Management

I have seen quite a few blogs around managing a ClickOnce application through TFS up to Visual Studio 2010. The process seems a little convoluted and so I cannot help but wonder if there has been any improvement with later versions of VS? I am using 2015 (VS, TFS & RM) so would love to hear of anyone has had more luck doing this on later versions.
Any help on the matter would be massively appreciated!
These settings worked for me :
/target:publish /p:PublishDir="$(build.artifactstagingdirectory)\\"/ /property:ApplicationVersion=1.0.0.$(Build.SourceVersion)
The $(Build.SourceVersion) variable will be the changeset / git commit id.
Then you can create a release to deploy this somewhere.
Create a website to deploy to.
Click Artifacts to select the artifact to deploy.
Select IIS Deployment to choose machines in a deployment group.
Click the menu icon highlighted to select the drop folder.
For further documentation about certificates + signing see other clickonce docs.
I think there's another option to create an html page, but you can just link to the .application file.
You could use the new build system vNext Build to achieve it. Just need to add Publish Build Artifacts step in the build process. You could write a PowerShell script, if you want to copy ClickOnce output to some directory like UNC path/IIS website folder. Here is a blog with detailed steps: Building ClickOnce apps using build vNext
If you still insist on using XAML build, this one will also meet your needs.

How to create a web deploy package for a website project during TFS build process?

My current TFS build process just build my website project and output all the files, such as assemblies, web.config, etc.
From here, I learned how to create a web deploy package with MSBuild in command line.
But I want to know how to insert this package step into my current TFS build process.
Thanks for any insight.
Create your release package by creating a publish profile through Visual Studio. For this example mine is called Release. this will create you a Release.pubxml file in a folder called Publish Profiles, under your project, check this into source control.
Then in your build definition, under the process tab.
Expand the 02. Build > 5 Advanced or similar depending on the version of TFS you are using, add the following to the MSBuild argument text box
/p:DeployOnBuild=true;PublishProfile=Release
ensure the PublishProfile has the same name as the one you created earlier (Release)
this will create your deployment package as part of the build

Resources