SlideShare uma empresa Scribd logo
1 de 33
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
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

Mais conteúdo relacionado

Mais procurados

Configuring SQL Server Reporting Services for ASP.NET Running on Azure Web Role
Configuring SQL Server Reporting Services for ASP.NET Running on Azure Web RoleConfiguring SQL Server Reporting Services for ASP.NET Running on Azure Web Role
Configuring SQL Server Reporting Services for ASP.NET Running on Azure Web Role
Allan Mangune
 
Browser Extension 2
Browser Extension 2Browser Extension 2
Browser Extension 2
Kentwelcome
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
Sébastien Levert
 

Mais procurados (20)

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

Semelhante a Build scripting with psake

Semelhante a Build scripting with psake (20)

Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
 
Yaetos_Meetup_SparkBCN_v1.pdf
Yaetos_Meetup_SparkBCN_v1.pdfYaetos_Meetup_SparkBCN_v1.pdf
Yaetos_Meetup_SparkBCN_v1.pdf
 
Flink Forward Berlin 2018: Robert Bradshaw & Maximilian Michels - "Universal ...
Flink Forward Berlin 2018: Robert Bradshaw & Maximilian Michels - "Universal ...Flink Forward Berlin 2018: Robert Bradshaw & Maximilian Michels - "Universal ...
Flink Forward Berlin 2018: Robert Bradshaw & Maximilian Michels - "Universal ...
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
 
Jenkins Job DSL plugin
Jenkins Job DSL plugin Jenkins Job DSL plugin
Jenkins Job DSL plugin
 
(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us
 
SamzaSQL QCon'16 presentation
SamzaSQL QCon'16 presentationSamzaSQL QCon'16 presentation
SamzaSQL QCon'16 presentation
 
Faster Data Integration Pipeline Execution using Spark-Jobserver
Faster Data Integration Pipeline Execution using Spark-JobserverFaster Data Integration Pipeline Execution using Spark-Jobserver
Faster Data Integration Pipeline Execution using Spark-Jobserver
 
Docker Cambridge: CI/CD for the Database - Powered by Containers
Docker Cambridge: CI/CD for the Database - Powered by ContainersDocker Cambridge: CI/CD for the Database - Powered by Containers
Docker Cambridge: CI/CD for the Database - Powered by Containers
 
C# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project RoslynC# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project Roslyn
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
ScyllaDB V Developer Deep Dive Series: Rust-Based Drivers and UDFs with WebAs...
ScyllaDB V Developer Deep Dive Series: Rust-Based Drivers and UDFs with WebAs...ScyllaDB V Developer Deep Dive Series: Rust-Based Drivers and UDFs with WebAs...
ScyllaDB V Developer Deep Dive Series: Rust-Based Drivers and UDFs with WebAs...
 
Building a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless frameworkBuilding a serverless company on AWS lambda and Serverless framework
Building a serverless company on AWS lambda and Serverless framework
 
KnativeCon 2022 - Knative Functions
KnativeCon 2022 - Knative FunctionsKnativeCon 2022 - Knative Functions
KnativeCon 2022 - Knative Functions
 
Apache spark undocumented extensions
Apache spark undocumented extensionsApache spark undocumented extensions
Apache spark undocumented extensions
 
Spark and scala reference architecture
Spark and scala reference architectureSpark and scala reference architecture
Spark and scala reference architecture
 
Developing .NET Core AWS Lambda functions
Developing .NET Core AWS Lambda functionsDeveloping .NET Core AWS Lambda functions
Developing .NET Core AWS Lambda functions
 
Ender
EnderEnder
Ender
 
Running Spark In Production in the Cloud is Not Easy with Nayur Khan
Running Spark In Production in the Cloud is Not Easy with Nayur KhanRunning Spark In Production in the Cloud is Not Easy with Nayur Khan
Running Spark In Production in the Cloud is Not Easy with Nayur Khan
 
Jump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on DatabricksJump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on Databricks
 

Último

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Último (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 

Build scripting with psake

Notas do Editor

  1. Its release day
  2. Its release day
  3. 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.
  4. 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....
  5. 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.
  6. 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
  7. 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
  8. 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
  9. 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
  10. A lot of .NET developers may already have experience with powershell
  11. 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
  12. Show the project, simple fizz buzz tdd with some fake acceptance tests Demo building, cleaning, testing Show dependencies
  13. Environment to deploy to
  14. Run only if params not null or empty
  15. psake Deploy psake Deploy -parameters "@{'env'='dev'}"
  16. Lists the available tasks, their aliases and what the depend on