An Intro to ALM Using TFS and Visual Studio for Source Control, Build Automation, Continuous Integration, Deployments, and Task Management
What is ALM? Application Lifecycle Management Another great Buzz Acronym for resumes Process and tools for design, development, testing, deployment and management of software projects. Creating software is more than just writing code Many of the concepts and implementations in this demo are easy and straightforward. Putting it all together in a complex environment is not.
Our Setup TFS On Premise. Running on my laptop. We’ll use TFS for: Task Tracking Source Control CI – Continuous Integration Automated Deployments Not included: Automated Testing QA Integration Dev Ops More
Why is this important Task Tracking Source Control Continuous Integration Automation
Don’t Wait This may be the most important slide in this section. Don’t allow ALM to be an after thought… you’ll never have time later.
Set Up TFS Customize TFS to meet your needs Iterations Areas Teams Create your own Work Item Types (Enhancement, Deliverable) Edit WIT add fields, defaults, lists, rules, etc. Tasks – Organize by feature, not by file
The Plan Create a new project Set up a CI Build Then add a database and add that to the CI Build Setup a “Deploy” Build Creates a Deployment Package Deploys to QA Every build is a release candidate. No touch. Setup a process to deploy same package to Production (or UAT, etc)
Create a new Web Project Here we go…
CI Build This build will “check our work”, compile, deploy to Integration Server Set Source Control Folder Build Defaults Copy to: \\asuslt\BuildOutput Agent Settings Create Work Item on Failure: False Don’t forget an original name for the builds - ANDY
Set up IIS (This is done already) Install Web Deploy Create Site EndToEndIntegration (port 71) Create Site EndToEndQA (port 72) Create Site EndToEndProd (port 73)
Integration Publish Profile Server: localhost SiteName: EndToEndIntegration DestinationUrl: localhost:71 Update Build with: /p:DeployOnBuild=true;PublishProfile=Integration
Set Up Publish Profiles and Transforms SysTest.pubxml QA.pubxml <appSettings> <add xdt:Transform="Replace" value="Integration" key="Environment" xdt:Locator="Match(key)"/> </appSettings> Web.Integration.config Web.QA.config
DacPac Create Project (Databases already exist on server, for ease of demo) Create Dev Publish Profile Dev.publish.xml Publish Manually Create Integration Profile Integration.publish.xml /p:DeployOnBuild=true;PublishProfile=Integration;CreatePackageOnPublish=t rue /t:build /t:publish /p:SqlPublishProfilePath=Integration.publish.xml
Connection String Add Connection string for Dev: <add name="EndToEnd" connectionString="Server=AsusLT;Database=EndToEndDev;User ID=ElmahManager;Password=elmah;Integrated Security=false;Trusted_Connection=false;" providerName="System.Data.SqlClient" /> Update Web.config Transform for Integration <connectionStrings> <add name="EndToEnd" connectionString="Server=AsusLT;Database=EndToEndIntegration;User ID=ElmahManager;Password=elmah;Integrated Security=false;Trusted_Connection=false;" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> </connectionStrings>
Deploy Build Trigger: Manual /p:DeployOnBuild=true;PublishProfile=QA;CreatePackageOnPublish=t rue /t:build /t:publish /p:SqlPublishProfilePath=QA.publish.xml
Getting to UAT and Prod I don’t have access to UAT and Prod Servers. Only Network Admins have access. parameters.xml setparameters.xml .bat file deployment Dacpac: can be scripted or run in SQL Management Studio
parameters.Xml <parameters> <parameter name= "Environment" description="Please provide an environment name" defaultValue="params default" tags=""> <parameterEntry kind="XmlFile" scope="web\.config$" match="/configuration/appSettings/add[@key='Environment']/@value " /> </parameter> </parameters>
Set Up Builds CI /p:DeployOnBuild=true;PublishProfile=Integration;CreatePackageOnPublish=true /t:build /t:publish /p:SqlPublishProfilePath=Integration.publish.xml Deploy /p:DeployOnBuild=true;PublishProfile=QA;CreatePackageOnPublish=true /t:build /t:publish /p:SqlPublishProfilePath=QA.publish.xml