SlideShare a Scribd company logo
Automating Your Build
Process With psake
(sah-kee) 🍶
@Adam_Crane5
Adam Crane
- @Adam_Crane5
- Hiker, Biker, Runner
- Pillar Artisan
- Current project involves C#, .NET, and DB2
based on a real events
9:16am On a Wednesday
Build scripting with psake
Build scripting with psake
Build scripting with psake
Build scripting with psake
Build scripting with psake
What We’re Going to Cover
- Why you should script your builds
- Why you should use psake
- psake
- Tasks
- Parameters
- Conditionally Run Tasks
- Force Build Failure
- Other Useful commands
Why Script Your Builds?
Automation
Why Script Your Builds?
Config as Code
Why Script Your Builds?
Simplify Your Deploy
Why psake?
- MSBuild, NAnt written in XML
- Rake comes with baggage
Why psake?
- Written in PowerShell Syntax
- Provides access the to whole .NET Framework
psake
- A Domain Specific Language to create build scripts
- Leverages PowerShell syntax
- Broken Down into
- Tasks
- Dependencies
- Parameters
- Properties
- Functions
Tasks
Task default -Depends Build
Task Build {
}
Task Test -Depends Build {
}
Task Clean {
}
Properties
properties {
$buildFile = “.MyProj.sln”
}
Parameters
> psake Deploy -parameters "@{'env'='dev'}"
Conditionally Run Tasks
Task default -Depends Build
Task Build {
}
...
Task Deploy -Depends Build -precondition { return $env }{
"Deploying $environment"
}
Force Build Failure
Task default -Depends Build
...
Task FailureTask {
cmd /c exit (1)
if ($lastexitcode -ne 0)
{
throw "Command-line program failed"
}
}
List Available Tasks to be Run
> psake -docs
To Wrap Up
Psake Automates Your Build
To Wrap Up
Psake Keeps Your Config as Code
To Wrap Up
Psake Simplifies Your Continuous Integration
Resources
- psake.readthedocs.io
- In Search of a Better Build System for .NET
Thanks!
@Adam_Crane5

More Related Content

ZIP
App engine beats pony.key
PDF
Put a Button on It: Removing Barriers to Going Fast
PPTX
Capybara + RSpec - ruby dsl-based web ui qa automation
PDF
Optimizing React at Postmates
KEY
Capybara
PDF
Capybara with Rspec
PPT
URLs in Joomla - How to get it right
PPTX
Selenium – Web Browser Automation
App engine beats pony.key
Put a Button on It: Removing Barriers to Going Fast
Capybara + RSpec - ruby dsl-based web ui qa automation
Optimizing React at Postmates
Capybara
Capybara with Rspec
URLs in Joomla - How to get it right
Selenium – Web Browser Automation

What's hot (20)

PDF
I Can Haz Services ??
PDF
Configuring SQL Server Reporting Services for ASP.NET Running on Azure Web Role
PDF
Rails engines
PPTX
Tokyo Azure Meetup #14 - Azure Functions Proxies
PPTX
High Performance Serverless Functions in Scala
PPT
Big Data DC - BenchPress
PPT
Streamlined Geek Talk
PDF
New features in Rails 6 - Nihad Abbasov (RUS) | Ruby Meditation 26
PPTX
Mean machine
PPTX
The automation challenge Kubernetes operators vs Helm charts
PPTX
Azkaban and Pig at LinkedIn
PDF
Fluent 2018: When third parties stop being polite... and start getting real
PDF
Browser Extension 2
PDF
Go Serverless with Java and Azure Functions
DOCX
Rails Concept
PDF
Communication tool & Environment for Remote Worker
PDF
Be Happy With Ruby on Rails - Ecosystem
PPTX
Introduction to ASPNET Core
PPTX
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
PPTX
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
I Can Haz Services ??
Configuring SQL Server Reporting Services for ASP.NET Running on Azure Web Role
Rails engines
Tokyo Azure Meetup #14 - Azure Functions Proxies
High Performance Serverless Functions in Scala
Big Data DC - BenchPress
Streamlined Geek Talk
New features in Rails 6 - Nihad Abbasov (RUS) | Ruby Meditation 26
Mean machine
The automation challenge Kubernetes operators vs Helm charts
Azkaban and Pig at LinkedIn
Fluent 2018: When third parties stop being polite... and start getting real
Browser Extension 2
Go Serverless with Java and Azure Functions
Rails Concept
Communication tool & Environment for Remote Worker
Be Happy With Ruby on Rails - Ecosystem
Introduction to ASPNET Core
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
Ad

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
ai tools demonstartion for schools and inter college
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
top salesforce developer skills in 2025.pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
Digital Strategies for Manufacturing Companies
Odoo Companies in India – Driving Business Transformation.pdf
Nekopoi APK 2025 free lastest update
Which alternative to Crystal Reports is best for small or large businesses.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Design an Analysis of Algorithms II-SECS-1021-03
Understanding Forklifts - TECH EHS Solution
Designing Intelligence for the Shop Floor.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
ai tools demonstartion for schools and inter college
Computer Software and OS of computer science of grade 11.pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
top salesforce developer skills in 2025.pdf
L1 - Introduction to python Backend.pptx
Digital Strategies for Manufacturing Companies
Ad

Build scripting with psake

Editor's Notes

  • #4: Its release day
  • #5: Its release day
  • #6: Its release day and the team has gathered for their morning standup. The tech lead Mark turns to the recently hired Sarah and says "Its tradition to have the newbie do the release so that they get familiar with the process. Theres a README included in the solution and it has all the steps. Let me know when you're done so I can let the business know." Now Sarah has been around the block a few times and has had no problems deploying software in the past so she says what the heck I'll give it a shot.
  • #7: So she opens the readme and finds something that closely resembles this: She needs to move files from one folder to another, Run the linter, Deploy stored procedures to the sql server, run tests and use the little orphan annie decoder pin to decipher the rest of the steps. It all looks a bit challenging, but being the new member to the team she doesn't want to give up too soon. So....
  • #9: The release has yet to go out, support is starting to get calls because for some reason the website now just points to a picture of Steves Cat.
  • #12: Automation Rarely is your application so simple that the default build button does everything you need it to do You may have any number of tasks that may need to happen in any given order to fully build and run your application For example on the project I am currently on, we must deploy stored procedures and functions, move files around and run entity framework migrations We want these tasks to be done consistently before builds, psake allows us to automate this As these tasks grow in numbers and complexity us humans get worse and worse at remembering all the tasks need to run before we can ship our code Lets let our computers do what they’re best at which is following a set of instructions
  • #13: Config as Code Your build steps are captured as code instead of a readme The build script is always checked in with your code and therefore kept up to date If you ever need to revert changes to a prior commit, your build will still work Eliminates the “works on my machine” adage Every developer should be able to run the build and have it work the same On our project we had developers saving cmd shortcuts to their desktops to run pre build scripts, now we use psake and every developer has access to the scripts this gives us is consistent and repeatable builds. The build will work the same on every machine every time
  • #14: Simplify your Deploy With a build script you can take your deploy step down to a single command line command. Releases become non events No more huddling around orchestrating the deployment with your team, simply execute your deploy command deploy independently from CI like Jenkins and TFS. You can take your multi step build process down to a single one. As mentioned in the slide before, if you need to revert back to a previous revision, that may require changing your whole build process, With a build script, your build and deployment processes are always in line and up to date with your code
  • #15: XML should be used to describe things not script things Rake requires you to write Ruby code which can be foreign to dotnet developers Rake also forces you to install Ruby gems which your standard windows box will not have
  • #16: A lot of .NET developers may already have experience with powershell
  • #17: psake is a domain specific language to create builds using a dependency pattern just like Ant, NAnt, Rake or MSBuild. Tasks are the core of Psake, They are what you break your build steps down to Recommend you handle your script like you would your code, with modularity You can make these tasks depend on each other You can pass parameters to theses tasks These tasks can make use of properties And because it is written in powershell you can write your own functions
  • #18: Show the project, simple fizz buzz tdd with some fake acceptance tests Demo building, cleaning, testing Show dependencies
  • #22: Environment to deploy to
  • #24: Run only if params not null or empty
  • #25: psake Deploy psake Deploy -parameters "@{'env'='dev'}"
  • #29: Lists the available tasks, their aliases and what the depend on