WinRT App CI on Jenkins(VS2013)

* Need install vs env on Win Server 2012

* MSTest not support Store App

* Need change Jenkins startup/logon account so that it can read code sign cert from cert store

****************************

So you need to setup continuous integration using Jenkins to drive Visual Studio 2013, eh? Unit Testing, too?  No problem.

 
This system, by far, has proven to be the easiest to understand among all of the Continuous Integration options explored so far (TeamCity, Bamboo).
 
Proof of concept build:
  1. Setup a virtual machine, loading the TurnKeyLinux Jenkins appliance.
  2. Go to, and log in to the new Jenkins machine.
  3. Manage Jenkins -> Manage Plugins -> Available / Installed
  4. Acquire the following plugins, and have them enabled:
  • Git Plugin
  • Git Client Plugin
  • BitBucket Plugin (because I was using BitBucket)
  • MSBuild Plugin ( compiler )
  • VSTest Runner Plugin ( unit tests - Microsoft's standard issue system )
  • NUnit Plugin ( unit tests - Popular pseudo standard issue system )
Install plugins + restart Jenkins ( the software; not the machine )Wait for the restartLog in againManage Jenkins -> Configure System (plugins are configured here)
  1. MSBuild
  • Click "MS Build installations..."
  • Click "Add MSBuild"
    • Name: ".NET 4.0"
    • Path to MSBuild: "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
  • Click "Add MSBuild"
    • Name: ".NET 3.5"
    • Path to MSBuild: "C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe"
  • Repeat as needed for other versions
VSTest
  • Click "VSTest installations..."
  • Click "Add VSTest"
    • Name: "VSTest Console"
    • Path to VSTest: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
SaveGo to Jenkins root (click "Jenkins" in the top-left corner)Manage Jenkins -> Manage Nodes -> New Node ( it's in the left-side menu )Create a dumb slave, representing a Windows + Visual Studio 2013 system
  • Provide a name
  • Root Directory: "C:\" (quotes not needed)
  • Launch Method: "Launch slave agents via Java Web Start" (this is the easiest option)
  • Save
Go to Jenkins root (click "Jenkins" in the top-left corner)Create a "New Item" (project)
  • Provide a name
  • Build a free-style software project
  • (optionally) Restrict where this project can be run ( provide the name of a "slave" / "agent" )
  • Source Code Management: "Git"
    • Provide URL
    • Provide Credentials (password is acceptable when you fully control the machine, SSH key is best in shared-with-team development mode)
  • Add Build Step ( compile - required )
    • "Build a Visual Studio project or solution using MSBuild"
      • Provide Build File ( a ".sln" is a good choice )
  • Add Build Step ( for Visual Studio's default test system - optional )
    • "Run unit tests with VSTest.console"
      • Provide the names of the DLLs produced (ex: Bank.Test.dll)
  • Add Build Step ( for NUnit - optional )
    • "Execute Windows batch command"
      • "C:\Program Files (x86)\NUnit 2.6.3\bin\nunit-console.exe" BankNTest/bin/Debug/BankNTest.dll /xml=NTestResults/nunit-result--%BUILD_NUMBER%--%BUILD_ID%.xml
Go to Jenkins root (click "Jenkins" in the top-left corner)Manage Jenkins -> Manage NodesClick on the newly created slave's nameRight-click the Orange "Launch" button, and save the file onto the slave machine (be creative: find a way to transfer the file)Log into the slave machineLaunch "slave-agent.jnlp" (the slave machine needs to have Java installed, and Visual Studio 2013 - and optionally NUnit as needed)Done
At this point, Jenkins should remotely launch builds and tests whenever you make a push to your git repository.  The above steps did not setup any "build triggers", because, my currently functional Jenkins project does not have any build triggers yet still works.

相关推荐