0

I currently have a CI Setup in TFS 2013 which does the following

  1. Pulls code down from Git on every commit to a branch
  2. Builds the Solution
  3. Runs N-Unit Tests Against the solution
  4. Runs Jasmine Front-end Tests against the javascript
  5. Deploys on success via WebDeploy to chosen server.

I have now managed to install Grunt and NodeJS on the server to do some manipulation of the Javascript between steps 5-6. Does anyone have any advice on how this might be done?

I've tried post-tests scripts to minify the javascript successfully on both the src and bin/_PublishedWebsites directory but this does not seem to persist over to the deployment server. And infact, the _PublishedWebsites route puts the build folder in an undeletable state due to maxmimum character limits on Windows files (argh).

2 Answers 2

2

You should switch over to using Release Management for Visual Studio 2013 (works with 2012 as well). This allows you to parameterize your release and push the same output through multiple environments. Very configurable and even makes sure that the tools you need end up on the server that you are deploying to. Supports Puppet, Chef, DSC, and create your own.

http://nakedalm.com/installing-release-management-server-tfs-2013/

And for an overview: http://nakedalm.com/building-release-pipeline-release-management-visual-studio-2013/

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the suggestion! I may be a little slower getting around to trying this out as a solution as i'll need to get it installed somewhere first.
I usually install the server on thebTFS server. I expect them to be integrated in the future
0

I managed to get this working with the addition of two extra steps to the pubxml file used for the deployment.

First, i added a dependency powershell script which ran NPM install and grunt tasks.

<PipelineDependsOn>
  CustomBeforePublish;
  $(PipelineDependsOn);
</PipelineDependsOn>
<Target Name="CustomBeforePublish">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -file  Pre_Deploy_Javascript_Build.ps1 $(ProjectDir)"/>
</Target>

Following this. I had now created additional files which did not exist in the project. I had to now ensure that these were published. To do this, i added another step.

 <CopyAllFilesToSingleFolderForMsdeployDependsOn>
  CopyMinJSFiles;
  $(CopyAllFilesToSingleFolderForMsdeployDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn >
<Target Name="CopyMinJSFiles">
<ItemGroup>
  <_MinJSFiles Include="$(ProjectDir)\App\*.js" />
  <FilesForPackagingFromProject  Include="%(_MinJSFiles.Identity)">
    <DestinationRelativePath>App\%(Filename)%(Extension)</DestinationRelativePath>
  </FilesForPackagingFromProject>
</ItemGroup>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.