Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT...

18
Grunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment

Transcript of Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT...

Page 2: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Grunt

• Task Runner

• Automation Testing

• Unit Testing

• Performance Budgeting

• Build Tools

• Transpilation

• Minification & Concatenation

• Much more…

Page 3: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Transpilation

• TypeScript

• Babel/ECMAScript 6

• Less

• Sass

Page 4: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Minify & Concat

• HTML

• CSS

• JavaScript

Page 5: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Live Reload

• Chrome

• Firefox

• Safari

Page 6: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

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.

Page 7: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Boxstarter

• Chocolatey Package Management for Windows

• PowerShell

• Installations

• System Modifications

• …even Task Bar Changes

• Automatic Reboots

• Virtual Machine Integration

Page 8: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Installation File

Drop on GitHub’s Gist for easy access on clean boxes

Page 9: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

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

Page 10: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

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

Page 11: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Engaging with GIT

• A Primary Tool in a DevOps Arsenal

• https://git-scm.com

Page 12: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

• 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?

Page 13: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

• 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?

Page 14: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

• 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

Page 15: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Sample GIT WorkFlow/Deployment

WorkingBare

Production Staging

Dev Servers/Clients

Example

Page 16: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

GIT with an Open Source Application ( WordPress )

Submodules and subtrees

Open Source

Page 17: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

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

Page 18: Grunt, Boxstarter, and GIT - University of Virginia · PDF fileGrunt, Boxstarter, and GIT Automation in development, desktop installations, and deployment. ... –Mac, Windows installers

Notes

[email protected]

[email protected]

[email protected]

https://github.com/szul/gruntstarter

https://gist.github.com/szul/03e4509484c7bf8ce9fb

Contact Information

Grunt Example Code

Boxstarter Example Gist