44
Go Commando!

CommandBox at CFCamp 2014

Embed Size (px)

DESCRIPTION

Presentation on CommandBox CLI, Package Manager for ColdFusion (CFML)

Citation preview

Page 1: CommandBox at CFCamp 2014

Go Commando!

Page 2: CommandBox at CFCamp 2014

WHO AM I?

• Luis Majano - Computer Engineer

• Born in El Salvador ------------------>

• Architecture + Software Design

• CEO of Ortus Solutions

• Adobe Community Professional

• Creator of all things Box: ColdBox, ContentBox, WireBox....

Page 3: CommandBox at CFCamp 2014

AGENDA

• How do we work in CF • A better way to work in CF • What is CommandBox • Features • Usage • Roadmap

Page 4: CommandBox at CFCamp 2014

HOW DO WE WORK IN CF?

Code% App%

CodeCode

CodeCode

Code

Code

Code

Page 5: CommandBox at CFCamp 2014

IT’S ALIVE!

Page 6: CommandBox at CFCamp 2014

Cool Kids

Page 7: CommandBox at CFCamp 2014

How we should work!

App#Package#Manager#

CLI#

REPL#

Automa6on#

OS#

Page 8: CommandBox at CFCamp 2014

We need to learn, study, and apply!

Page 9: CommandBox at CFCamp 2014

Introducing…

Page 10: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 11: CommandBox at CFCamp 2014

Who is this for?

• For any ColdFusion (CFML) Developer • Commands For:

• Operating System Integration • Executing CFML Code • ColdBox Developers • TestBox BDD/TDD • ContentBox Developers • Any framework/app developer

Page 12: CommandBox at CFCamp 2014

Installation

Java 1.7+

33mb

v1.0.0 Beta <7 months of development

Long ways to go!

Page 13: CommandBox at CFCamp 2014

We are POSS

• GitHub

• https://github.com/Ortus-Solutions/commandbox • Professional Support

• Training + Mentoring

• Development

• Support

• Salsa Lessons are Optional

Brad WoodSalsa King

Page 14: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 15: CommandBox at CFCamp 2014

Usage - CLI vs Shell

box myapp.cfm Shell

Page 16: CommandBox at CFCamp 2014

Usage - OS Execution

OS +

CFML

Execute CFML Filesbox myapp.cfm &

Enhanced Executionbox execute myapp.cfm name=luis

param=hello

Box Scripting: *Unix#!/usr/bin/env box

Page 17: CommandBox at CFCamp 2014

Usage - Commands

• How you get things done! • Built-in Help • Command Namespaces

• Commands • Aliases • Parameters/Arguments

• Tab-Completion • Commands, Parameters, Paths, ForgeBox, Custom

Page 18: CommandBox at CFCamp 2014

Usage - Parameters

• Named • Positional • Boolean Flags • Escaped Input • Required Values • Completion

Page 19: CommandBox at CFCamp 2014

Usage - History

• Command History • REPL History • Clear History

Page 20: CommandBox at CFCamp 2014

Usage - OS Integration

• OS Integration Commands • Output Piping

• | • File Redirection

• > Create • >> Append

• Open • Files/Directories

• Browser • Run OS Binaries

Page 21: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 22: CommandBox at CFCamp 2014

What’s a package?

• A folder or zip/tar file that must contain: • box.json

• It must be in the root!

Page 23: CommandBox at CFCamp 2014

box.json

• Package Descriptor • Declares package metadata

• Name • Slug • Version • Author • Dependencies • DevDependencies • Installation Details

• Custom Metadata

Page 24: CommandBox at CFCamp 2014

box.json

Page 25: CommandBox at CFCamp 2014

Where do they come from?

• ForgeBox • File zip/tar • Directory • Git • SVN • Github • Bitbucket • Custom

Page 26: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 27: CommandBox at CFCamp 2014

ForgeBox

• Cloud package repository • Web GUI • Community driven • 145+ packages • Help us out! • www.forgebox.org coming soon!

Page 28: CommandBox at CFCamp 2014

Package Commands• forgebox

• install • uninstall • update • search • show • types • slugcheck

• artifacts • remove, list, clean

• package • show, init, clear, set

Page 29: CommandBox at CFCamp 2014

Packaging Features

• Can distribute without dependencies • Can have development dependencies • Dependencies Inception • “install” to initialize a project • “update” to update dependencies

Page 30: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 31: CommandBox at CFCamp 2014

Read - Eval - Print - Loop

• Executes code • Support Tags or CFScript • History • Multi-line Statements • Declare closures, functions, etc • Keeps state

REPL

Page 32: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 33: CommandBox at CFCamp 2014

Integrated Server• Lightweight servlet container : undertow • Startup ad-hoc servers in any folder • Keeps track of servers, no WEB-INF needed • Server

• start • stop • restart • status • log • open • forget

• Railo + Adobe CF

Page 34: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 35: CommandBox at CFCamp 2014

Scaffolding

• ColdBox Applications • ContentBox Applications • TestBox Integration • Available For Any Framework or Application • Preside CMS

Page 36: CommandBox at CFCamp 2014

Scaffolding

initcoldbox create app “MyApp” —-installColdBoxBEcoldbox create handler contacts index,save,deletecoldbox create module MyModuleinstall testbox-bepackage set defaultPort=“90001”package set testbox.runner=“localhost:90001/tests/runner”testbox run

Page 37: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 38: CommandBox at CFCamp 2014

Automation Commands• run

• Execute any OS binary • Integrate with grunt/gulp/ant

• execute

• Enhanced execution • Can accept parameters

• recipe

• Like a “Batch” file: !#/usr/bin/box • Runs multiple commands • Can accept parameters • my-recipe.boxr

Page 39: CommandBox at CFCamp 2014

# Init a repositorymkdir $nameinit $namerun git init# Create ColdBox Appcoldbox create app $1 —installColdBoxBEcoldbox create handler $2 index,save,deletecoldbox create module $3# Prepare for Testinginstall testbox-bepackage set defaultPort=“$4”package set testbox.runner=“localhost:$4/tests/runner”

my-recipe.boxr

recipe my-recipe.boxr MyApp

Page 40: CommandBox at CFCamp 2014

What is CommandBox?

CLI PackageManager

REPL

Read-EvalPrint-Loop

IntegratedServer

ScaffoldingForgeBox

CFML

ColdFusion Automation

Page 41: CommandBox at CFCamp 2014

ColdFusion Extensibility

• Commands are CFML • Create custom commands • Register in ForgeBox • DI/AOP Capabilities • Favorite Command

• CommandBox-Chuck-Norris

CFML

Page 42: CommandBox at CFCamp 2014

Roadmap

Task Runners

Adobe CF Engine

ForgeBox 2.0

ForgeBox Enterprise

More Generators

Automation/Async

Page 43: CommandBox at CFCamp 2014

Resources• Official Site

• http://ortussolutions.com/products/commandbox • Documentation

• http://apidocs.ortussolutions.com/commandbox/1.0.0/ • https://ortussolutions.com/products/commandbox/docs/current

• Google Group

• https://groups.google.com/a/ortussolutions.com/forum/#!forum/commandbox • Training

• http://ortussolutions.com/services/training • Professional Support

• http://ortussolutions.com/services/support

Page 44: CommandBox at CFCamp 2014

Thanks!

Q & A