The Ortus BlogBox

"Ortus: A rise, beginning, coming into being, born, the origin!"

 

 

Category Filtering: 'commandbox'

 

Portainer Docker Support for CommandBox and ContentBox

Luis Majano
May 23, 2017

 

We are very excited that the Portainer.io crew has added support for CommandBox and CommandBox docker image deployment. If you have not heard of Portainer, then let's start there first.

What is Portainer


Portainer is an open-source lightweight management UI for easily managing your docker host or a swarm cluster. It is available as a docker image or a standalone binary for any operating system. I was quite impressed with all the functionality out of the box with portainer, and the ease of use of the interface. It really made, for me, put all the questions I had about docker to rest thanks to finally visualizing them. I also found useful their live demo, which is great as well and got my appettite ready for delving into it.

Starting Portainer

To do a quick start for portainer just use the following commands:

docker run -d -p 9000:9000  \
   -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer

This will run the docker container for portainer on port 9000 and it will manage the local Docker engine.

Please note that you can manage any docker endpoint or swarm cluster. Pelase refer to their documentation for further instructions: https://portainer.readthedocs.io/en/stable/deployment.html#quick-start

Application Templates

Portainer has the concept of quick application templates for easily deploying applications and trying them out. From here you can navigate their great collection and you will find our two docker images: CommandBox and ContentBox. We will use them to launch CFML applications with CommandBox or a full fledge CMS instance using ContentBox CMS. Below are the screenshots for each template so you can get started with ColdFusion (CFML) and ContentBox CMS with docker:

CommandBox Template

Using the CommandBox template you can fill out the following information:

  • The name of the container
  • The type of networking
  • Ownership in Portainer (Portainer supports multi-user access and runnable rights)
  • Port Mappings for HTTP and HTTPS
  • Volume Mapping for the running ColdFusion application

You can run the template as is and it will generate the sample ColdFusion page which is not very fancy. So we would encourage you to point it to a ColdFusion application so you can see your application being dockerized!

Please note that once the image spins up you can add more environment variables and further configuration settings by visiting the containers area.

ContentBox CMS Template

Using the ContentBox CMS template you can fill out the following information:

  • The name of the container
  • The type of networking
  • Ownership in Portainer (Portainer supports multi-user access and runnable rights)
  • Port Mappings for HTTP and HTTPS
  • Volume Mappings for the following:
  • The storage of the in-memory database (Express edition is the default in portainer)
  • The media location for assets

You can run the template as is and it will generate a new ContentBox CMS site with its very own in-memory H2 database and clustering capabilities. However, you will need to follow the installer and then remove it via environment variables so it does not recreate the image on each startup. Please refer to our docker image documentation for further information.

Please note that once the image spins up you can add more environment variables and further configuration settings by visiting the containers area.

What's Next!

In coming tutorials we will be demonstrating how to use Portainer to leverage a docker swarm with our images. From service creations, to on-the-fly modifications and much more. So stay tuned!

ColdBox MVC, ColdFusion, CommandBox, ContentBox CMS, Docker, Tutorials 0

Using "testbox watch" to Automate Your Testing Suite

Brad Wood
May 19, 2017

 

There is a new command in town in the CommandBox 3.7 snapshot build.  If you want to get the current snapshot build of CommandBox 3.7 to try this out, and play with it, simply run the following command and it will direct you to the latest bleeding edge download page:

CommandBox> upgrade --latest

What does it do?

This command is called testbox watch and it is similar to testbox run which can be used to run your projects unit or integration tests.  The difference is that testbox run will run your tests a single time right then, whereas the testbox watch command will stay running until you stop it with Ctrl+C.  The command will watch the files in your project for changes, and every time you save a CFC file, it will run your tests immediately, outputting the results to the console window.  This gives you instant feedback as you develop as to whether you just broke something.

CommandBox> testbox watch

Watching Files...

Executing tests via http://127.0.0.1:59060/tests/runner.cfm?&recurse=true&reporter=json, please wait...
TestBox v2.5.0-snapshot
---------------------------------------------------------------------------------
| Passed  | Failed  | Errored | Skipped | Time    | Bundles | Suites  | Specs   |
---------------------------------------------------------------------------------
| 16      | 0       | 0       | 0       | 132 ms  | 2       | 4       | 16      |
---------------------------------------------------------------------------------

Stopping...

CommandBox>

 

If you want to see a demo of this in action, check out this screencast I made.  

 

Configuring Your Watcher

As usual, you can get help on any CommandBox command by adding the word "help" to the end of it.
CommandBox> testbox watch help

You will see that there are a handful of way to configure how it runs.  The watcher itself can be controlled by setting up the parameters you want in your box.json file for the project.  Here's a rundown of the configuration elements you can set.  All of these are optional except the testbox.runner.

Where are your tests located?

CommandBox> package set testbox.runner=http://localhost:8080/tests/runner.cfm

Do you want verbose test output, or compact?

CommandBox> package set testbox.verbose=false

Only runs tests with these labels

CommandBox> package set testbox.labels=foo

Choose the test suites to execute

CommandBox> package set testbox.testSuites=bar

Control how often the watcher checks the file system for changes.

CommandBox> package set testbox.watchDelay=1000

Customize exactly what files to watch for changes with a list of globbing patterns

CommandBox> package set testbox.watchPaths=/models/**.cfc

Your box.json file

So your box.json file may look something like this once you've set it up.

{
    "testbox":{
       "runner":"http://localhost:8080/tests/runner.cfm",
       "labels":"foo",
       "bundles":"test.specs",
       "testSuites":"bar",
       "verbose":"false",
       "watchDelay":"1000",
       "watchPaths":"/models/**.cfc"
   }
}

 

 
CommandBox, TestBox, Tutorials 0

DC CF.Objective() 2017 CommandBox Training Discounts

Luis Majano
May 19, 2017

 


If you will be attending this year's CF.Objective (Which you should!) on July, then you can attend our ColdFusion CommandBox training (July 18-19) and get a whooping 25%! You can use the discount code cfobjective and be on your way to learn how to evolve your legacy ColdFusion applications by using modern tooling like CommandBox!

You can also follow this link: https://dc2017-commandbox.eventbrite.com?discount=cfobjective to purchase your registration.

Course Information

In this training we will review the ins and outs of CommandBox so you can incorporate it as your ColdFusion companion tool. From CLI and operating system integration to ColdFusion engine management and portability with Docker and container strategies. This training series will be led by CommandBox creators Brad Wood and Luis Majano. Whether you are a ColdFusion expert or novice, this bootcamp will challenge you and refresh your skills to be able to modernize your ColdFusion (CFML) applications and servers.

ColdFusion, CommandBox, Community, Conferences, Training 0

CommandBox FusionReactor Module v1.6.0 released

Brad Wood
Apr 18, 2017

 

We've had our CommandBox FusionReactor Module out for about 6 months now which lets you easily enable FusionReactor on your CommandBox servers.  It works for Lucee and Adobe servers alike and requires no manual installation. All you need to do is install the module and add in your license key with these two commands:

CommandBox> install commandbox-fusionreactor
CommandBox> fusionreactor register "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
CommandBox, Tutorials 0

Where are my Lucee and Adobe ColdFusion log files on CommandBox servers?

Brad Wood
Apr 10, 2017

 

As more people are starting to use CommandBox to start their Adobe ColdFusion and Lucee servers, I've gotten the question of where to find their log files.  The servers that CommandBox starts are full fledged servers with a web admin and all the same log files you'd expect.  However, CommandBox skips the vendor installer and uses the WAR files of each engine for a quick and lightweight deployment that can be deleted later and won't conflict with other servers, no matter how many you have.

CommandBox, Tutorials 0

CommandBox 3.6.0 Released

Brad Wood
Mar 10, 2017

 

We are proud to announce the general availability of CommandBox 3.6.0.  This is a minor release of the CLI tool that contains mostly bug fixes and small enhancements.  You can download the latest version from the CommandBox download page.  We've updated the GitBook docs and Command API docs as well.

CommandBox, Releases 0

Don't touch that Node-- write your own command line tools in CFML!

Brad Wood
Mar 02, 2017

 

There's a lot of command tools out there written by developers to help them automate all sorts of tasks from code refactoring, linting, and builds. Node has become a popular tool to write reusable tools that can be run from the command line, but many CF developers don't realize that CommandBox has allowed developers to do this nativley in CFML for years now.

CommandBox, Tutorials 5

How to use a database in CLI scripts with CommandBox

Brad Wood
Feb 21, 2017

 

One of the cool things that CommandBox allows you to do is run CFML code directly from the command line via the execute command, or on Unix as a natively-executable hash bang script. This opens up all sorts of doors for scheduling cron jobs and whatnot that you can write in CFML much faster and esaier than using bash or shell scripts. One common question is how to access the database from one of these scripts.

CommandBox, Lucee, Tutorials 0

Easy custom site host names with CommandBox

Luis Majano
Feb 14, 2017

 

In this video Brad Wood introduces the CommandBox Host Updater Module written by Chris Schmitz: https://www.forgebox.io/view/commandbox-hostupdater which allows you to automatically add host entries to your operating system and starting servers all on port 80 for you using CommandBox. It is really a great example of a CommandBox module, but also a great tool to have for ALL your ccustom development work. Enjoy!

Video

Installation

To get started with this module, simple use your CommandBox console to install it and running: box install commandbox-hostupdater. That's it, enjoy!

CommandBox, ForgeBox 3

CommandBox 3.5.0 Released

Brad Wood
Jan 10, 2017

 

We are pleased to announce the final release of CommandBox 3.5.0.  This is a minor release, with 53 completed tickets-- most of which are server enhancements focused on making server management and configuration easy across any engine.  This version has been in release candidate for a few weeks and has received a lot of testing.  As a minor release, there are no compatibility-breaking changes to any of the public APIs, but there has been some necessary restructuring of the back end bits related to starting servers that could possibly have an effect on you if you have any scripts or custom modules based on the previous folder structure of some server installs.  We recommend all users upgrade to this new version, but take a minute to review the changes so you can fully utilize the new features.

CommandBox, News, Releases 0
1 2 3 4 5 6 ... 9 >>