SlideShare a Scribd company logo
Grunt training deck
Introduction
➔
➔
➔
➔

Grunt is a workflow / task automation tool.
Built on top of Node.js.
Primary focus is web development.
Awesome range of plugins.
A workflow / task automation tool
Build automation is the act of scripting or automating a wide variety of tasks
that software developers do in their day-to-day activities including things like:
●

compiling computer source code into binary code

●

packaging binary code

●

running tests

●

deployment to production systems

●

creating documentation and/or release notes
Built on top of
It’s better than…
● Shell scripts / Batch files
● ANT
● Rake

➔ It’s written in JavaScript, and we all know that.
➔ It’s modular, and manages its own dependencies in a
clean, source-control friendly way.
Focus is on web development
Enough talk.
Show me some magic.
Let’s see what we can do with Grunt: http://bit.ly/19A7Vq7
This is cool, and it’s flexible. We can make it work with PHP/.NET
How did we achieve that?
Plugins.
Grunt training deck
Plugins
grunt-contrib-watch

Watch filesystem for changes

grunt-file-creator

Create arbitrary files

grunt-contrib-connect

Start a simple web server

grunt-text-replace

Replace text in files

grunt-open

Launch a browser

grunt-git-describe

Get tags from Git

grunt-contrib-concat

Concatenate files

grunt-contrib-copy

Copy files

grunt-contrib-sass

Compile SASS files

grunt-contrib-compress

Create Zip/Tar/Gz files

grunt-contrib-clean

Empty a directory

grunt-connect-rewrite

Symlinks for web server

assemble

Generate a static website from templates

grunt-karma

Karma testing

grunt-imageoptim

Optimize images

grunt-plato

JS Static code analysis

grunt-aws-s3

Upload/Download from AWS S3
Grunt does two really useful things.
➔ It ties your plugins together
and runs them in a specific order.
➔ It normalises (to a certain extent) the format in which
you supply options to the plugins.

As an added bonus…
➔ Grunt + NPM helps manage build dependencies.
Time for another trick.
...installing a project from scratch.
Starting from scratch*
➔ Fresh directory / machine
➔ Node.js & Grunt Cli installed (but nothing more)
➔
➔
➔
➔

git clone https://github.com/psyked/grunt-example-project
cd grunt-example-project
npm install
grunt
What is this magic?
It’s package.json
Introducing package.json
➔ It’s a standard part of Node.js
➔ It describes your project, including its dependencies.
➔ It gets auto-updated as you ‘install’ additional plugins for
your project.
➔ Create one using npm init
➔ Auto-add dependencies by installing them with the -save-dev flag
Enough talk.
Show me how.
First up, let’s get started with Grunt
1. Install Node.js
2. From the command line, run:
npm install grunt-cli -g
Running Grunt tasks
➔ Run a default task:

grunt

➔ Run a specific task:

grunt taskname

➔ Run a task config:

grunt taskname:config
Grunt training deck

More Related Content

PDF
Front-end development automation with Grunt
PDF
OSDC.no 2015 introduction to node.js workshop
ODP
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
PDF
Preprocessor Workflow with Grunt
ODP
What grunt?
PPTX
Grunt - The JavaScript Task Runner
PPTX
Confoo - Javascript Server Side : How to start
PPTX
Grunt to automate JS build
Front-end development automation with Grunt
OSDC.no 2015 introduction to node.js workshop
Eclipse Buildship DemoCamp Hamburg (June 2015) with additional screenshots
Preprocessor Workflow with Grunt
What grunt?
Grunt - The JavaScript Task Runner
Confoo - Javascript Server Side : How to start
Grunt to automate JS build

What's hot (20)

PDF
The swiss knife of a word press developer
PDF
Grunt JS - Getting Started With Grunt
PDF
The Self-Service Developer - GOTOCon CPH
PPTX
Creating a continuous delivery pipeline with docker
PDF
Serverless
PDF
Introduction to Express and Grunt
PDF
Node & Express as Workflow Tools
PPTX
Grunt Continuous Development of the Front End Tier
PDF
Cross-platform Desktop application with AngularJS and build with Node-webkit
PDF
Docker + Tenserflow + GOlang - Golang singapore Meetup
PDF
Development tools at Base
PPTX
PPTX
GWTcon 2015 - Best development practices for GWT web applications
PPTX
dotnetsheff: Continuous delivery with Team City and Octopus Deploy
PDF
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
PPTX
Modern web technologies
PPTX
Bringing Javascript to the Desktop with Electron
PDF
Dockerfile best practices
PDF
Octopus Deploy Tech Fest 2014
The swiss knife of a word press developer
Grunt JS - Getting Started With Grunt
The Self-Service Developer - GOTOCon CPH
Creating a continuous delivery pipeline with docker
Serverless
Introduction to Express and Grunt
Node & Express as Workflow Tools
Grunt Continuous Development of the Front End Tier
Cross-platform Desktop application with AngularJS and build with Node-webkit
Docker + Tenserflow + GOlang - Golang singapore Meetup
Development tools at Base
GWTcon 2015 - Best development practices for GWT web applications
dotnetsheff: Continuous delivery with Team City and Octopus Deploy
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Modern web technologies
Bringing Javascript to the Desktop with Electron
Dockerfile best practices
Octopus Deploy Tech Fest 2014
Ad

Viewers also liked (7)

PDF
Agile Partners
PDF
Web fonts FTW
PDF
Responsive images in 10 minutes
PDF
Virtualisation - Vagrant and Docker
DOCX
Sindrom ovarium polikisti1
PDF
Frasa preposisional dan struktur adjung dalam bahasa rongga
PPTX
Agile Partners
Web fonts FTW
Responsive images in 10 minutes
Virtualisation - Vagrant and Docker
Sindrom ovarium polikisti1
Frasa preposisional dan struktur adjung dalam bahasa rongga
Ad

Similar to Grunt training deck (20)

PDF
Grunt.js and Yeoman, Continous Integration
PPT
Continuous Integration using Cruise Control
PDF
Automate your WordPress Workflow with Grunt.js
PDF
Building your own personal minion with grunt.js
PPTX
Modern Development Tools
PPTX
WordPress automation and CI
PPT
Life of a Chromium Developer
PDF
Making your app soar without a container manifest
PDF
The Secrets of The FullStack Ninja - Part A - Session I
PPTX
Improving build solutions dependency management with webpack
PPTX
Overview of Node JS
ODP
DevAssistant, Docker and You
PDF
Angular based enterprise level frontend architecture
PDF
My "Perfect" Toolchain Setup for Grails Projects
PDF
Gradle
PPTX
Introduction to node.js By Ahmed Assaf
PDF
ICONUK 2015 - Gradle Up!
PDF
Buildr - build like you code
PPTX
Cypress for Testing
PDF
GruntJS
Grunt.js and Yeoman, Continous Integration
Continuous Integration using Cruise Control
Automate your WordPress Workflow with Grunt.js
Building your own personal minion with grunt.js
Modern Development Tools
WordPress automation and CI
Life of a Chromium Developer
Making your app soar without a container manifest
The Secrets of The FullStack Ninja - Part A - Session I
Improving build solutions dependency management with webpack
Overview of Node JS
DevAssistant, Docker and You
Angular based enterprise level frontend architecture
My "Perfect" Toolchain Setup for Grails Projects
Gradle
Introduction to node.js By Ahmed Assaf
ICONUK 2015 - Gradle Up!
Buildr - build like you code
Cypress for Testing
GruntJS

More from James Ford (9)

PDF
The Magic of Charts
PDF
Telling Tales and Solving Crimes with New Relic
PDF
ES6, WTF?
PDF
Git 101: Force-sensitive to Jedi padawan
PDF
'Hack to the future' - Hackathons at MMT Digital
PDF
Fork me!
PDF
What the HTML? - The Holy Grail
PDF
Testacular
PPTX
The Flash Facebook Cookbook - FlashMidlands
The Magic of Charts
Telling Tales and Solving Crimes with New Relic
ES6, WTF?
Git 101: Force-sensitive to Jedi padawan
'Hack to the future' - Hackathons at MMT Digital
Fork me!
What the HTML? - The Holy Grail
Testacular
The Flash Facebook Cookbook - FlashMidlands

Recently uploaded (20)

PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Modernizing your data center with Dell and AMD
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
KodekX | Application Modernization Development
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Modernizing your data center with Dell and AMD
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectral efficient network and resource selection model in 5G networks
Advanced methodologies resolving dimensionality complications for autism neur...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KodekX | Application Modernization Development
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf

Grunt training deck

  • 2. Introduction ➔ ➔ ➔ ➔ Grunt is a workflow / task automation tool. Built on top of Node.js. Primary focus is web development. Awesome range of plugins.
  • 3. A workflow / task automation tool Build automation is the act of scripting or automating a wide variety of tasks that software developers do in their day-to-day activities including things like: ● compiling computer source code into binary code ● packaging binary code ● running tests ● deployment to production systems ● creating documentation and/or release notes
  • 4. Built on top of It’s better than… ● Shell scripts / Batch files ● ANT ● Rake ➔ It’s written in JavaScript, and we all know that. ➔ It’s modular, and manages its own dependencies in a clean, source-control friendly way.
  • 5. Focus is on web development
  • 6. Enough talk. Show me some magic.
  • 7. Let’s see what we can do with Grunt: http://bit.ly/19A7Vq7
  • 8. This is cool, and it’s flexible. We can make it work with PHP/.NET
  • 9. How did we achieve that? Plugins.
  • 11. Plugins grunt-contrib-watch Watch filesystem for changes grunt-file-creator Create arbitrary files grunt-contrib-connect Start a simple web server grunt-text-replace Replace text in files grunt-open Launch a browser grunt-git-describe Get tags from Git grunt-contrib-concat Concatenate files grunt-contrib-copy Copy files grunt-contrib-sass Compile SASS files grunt-contrib-compress Create Zip/Tar/Gz files grunt-contrib-clean Empty a directory grunt-connect-rewrite Symlinks for web server assemble Generate a static website from templates grunt-karma Karma testing grunt-imageoptim Optimize images grunt-plato JS Static code analysis grunt-aws-s3 Upload/Download from AWS S3
  • 12. Grunt does two really useful things. ➔ It ties your plugins together and runs them in a specific order. ➔ It normalises (to a certain extent) the format in which you supply options to the plugins. As an added bonus… ➔ Grunt + NPM helps manage build dependencies.
  • 13. Time for another trick. ...installing a project from scratch.
  • 14. Starting from scratch* ➔ Fresh directory / machine ➔ Node.js & Grunt Cli installed (but nothing more) ➔ ➔ ➔ ➔ git clone https://github.com/psyked/grunt-example-project cd grunt-example-project npm install grunt
  • 15. What is this magic? It’s package.json
  • 16. Introducing package.json ➔ It’s a standard part of Node.js ➔ It describes your project, including its dependencies. ➔ It gets auto-updated as you ‘install’ additional plugins for your project. ➔ Create one using npm init ➔ Auto-add dependencies by installing them with the -save-dev flag
  • 18. First up, let’s get started with Grunt 1. Install Node.js 2. From the command line, run: npm install grunt-cli -g
  • 19. Running Grunt tasks ➔ Run a default task: grunt ➔ Run a specific task: grunt taskname ➔ Run a task config: grunt taskname:config