Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT...
Transcript of Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT...
Grunt, Boxstarter, and GIT
Automation in development, desktop installations, and deployment
Grunt
• Task Runner
• Automation Testing
• Unit Testing
• Performance Budgeting
• Build Tools
• Transpilation
• Minification & Concatenation
• Much more…
Transpilation
• TypeScript
• Babel/ECMAScript 6
• Less
• Sass
Minify & Concat
• HTML
• CSS
• JavaScript
Live Reload
• Chrome
• Firefox
• Safari
Drawbacks
• Possibly requires installation of additional programs
• nodejs
• npm packages (e.g., bower)
• Task Runner Explorer
• Visual Studio Node Toolkit
• Grunt Launcher
• Package Intellisense
Technical leads/managers might not be willing to adopt tooling
that requires each developer to install additional programs.
A better way to manage/install packages is necessary.
Boxstarter
• Chocolatey Package Management for Windows
• PowerShell
• Installations
• System Modifications
• …even Task Bar Changes
• Automatic Reboots
• Virtual Machine Integration
Installation File
Drop on GitHub’s Gist for easy access on clean boxes
Easy URL Installation
http://boxstarter.org/package/url?https://gist.githubusercontent.com/sz
ul/03e4509484c7bf8ce9fb/raw/39aa3664eee11f523877df8216e12333
a64e3472/Boxstarter.ps1
• Installs the Boxstarter Web Launcher
• Installs Chocolatey
• Runs Script (installations/modifications)
• Reboots when needed/starts script up where it left off
Beyond the Desktop
• Use in conjunction with Vagrant to build development machines
• Spin up Azure VMs for development, testing, and production
• Easily spawn GIT repositories with post hooks for deployment
Engaging with GIT
• A Primary Tool in a DevOps Arsenal
• https://git-scm.com
• A tool for assisting code development by versioning, deployment, and sharing.
– SVN, TFS, Mercurial, Fossil
– A free flexible application that is well supported
– An application that runs on multiple OS’s, (Windows, *Nix, MAC)
– Easily distributed for use in private environments –GitHub/Beanstalk, etc. not required
• What it’s not
– A backup of your filesystem
– An archiver of Images and Media
– Your only Disaster Recovery plan
What is it?
• Higher code quality and speeding deployment
– Versioning – track what each version does
– Merge tools that allow for review before commits
– Easily create branches for fixes/testing which can get pushed back
– Logging changes by whom, when, and what
– Ability to undo commits and redeploy
– Ability to deploy to multiple servers on rollout, and even rollback if necessary
• Helps you develop your workflow and development processes
Why?
• https://git-scm.com/downloads
– Debian, CentOS have repos, source for other *nix installs
– Mac, Windows installers – they take you through process
• Create first repo
– git clone [source url], - WordPress, Drupal, OS CMSs, etc
– git init [within your working code directory]
– Bare repos are best for your ‘Master’ to deploy from.
Getting Started
Sample GIT WorkFlow/Deployment
WorkingBare
Production Staging
Dev Servers/Clients
Example
GIT with an Open Source Application ( WordPress )
Submodules and subtrees
Open Source
Sample Updates WorkFlow
Download WP updates, plugin updates ( submodules) – use new version
1. Push to testing server branch
2. If custom code breaks, roll back dates OR fix code, and pull into current version
3. If tests are good, push new version to bare repo
4. Deploy bare repo to staging for more testing.
5. Deploy to live server via post-receive hooks
** If your updates require database changes, you will need to script those changes into the process. Currently we do have scripts to help assist with deployment, and we will update our scripts to being together the different steps with automation.
Tools like Jenkins assist with this.
Sample Updates
Notes
https://github.com/szul/gruntstarter
https://gist.github.com/szul/03e4509484c7bf8ce9fb
Contact Information
Grunt Example Code
Boxstarter Example Gist