Coldbox compile command, what will it do?

There is a “compile” command in the coldbox namespace, but it is a placeholder. Is there a doc on what this is planned to do? Possibly to do with the JavaCompiler?

I’m looking for an easy way to compile CFML for syntax error checking via Bamboo CI, as it would be a great way to do a first pass check to see if someone broke the build before spinning up the servers, unit testing, then functional testing.

I currently have commandbox running the (cf)admin action=“compileMapping” and action=“createArchive” functions, but unfortunately you have to set a password in the railo-server.xml file each time (The CLI engine runs with no password, I found out. Thanks Brad Wood! ). Not too involved, but would be much nicer with a simple “compile” command with output for the CI server. Like “php -l”

Oops, I mentioned php…

Thanks!

Hi Ken, I’m not entirely sure why we put the compile command inside the “coldbox” namespace. It’s one of a handful of commands we dreamed up at the beginning but have yet to implement. I think Luis typed that down down on the list so he can jump in here if I’m wrong but I believe it was to be used for exactly what you’re doing-- compiling CFML code down into bytecode. We’d need to figure out how to support all the different engines for it and I’m thinking Adobe CF uses a stand-alone tool for compilation.

We’d love your contributions on getting a prototype of the command setup. Let me ping Luis and see if we can move the compile command outside of “coldbox” as a general purpose utility, or if he had a different idea in mind for it.

Regardless, of what we do, keep in mind you can always just go and create your own command and stick it on forgebox for the whole community to use. Here’s links to a couple existing commands I created:

http://ortus.gitbooks.io/commandbox-documentation/content/developing_commands/forgebox_distribution.html

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Actually, my idea for it was to do auto-compilation of java sources for you.

So basically have a /src folder in your ColdBox app with java or groovy code. Then the compile commands would take care of ccompiling and moving to the /lib folder.

However, this sounds cool too. Maybe another command?

Thanks guys, I’ll look to package anything I do into a command if possible. The only thing I see as a possible sticking point to doing this would be the missing password in the railo-server.xml for the CLI. (That is needed to call cfadmin) I’m not sure if a custom command could change that programmatically, but I’ll see if I can figure it out. Any thoughts on the security implications of setting the password to a default in a future version of commandbox? It could be 12345, like my luggage! :slight_smile:

That’s a good observation, but not sure we can do that upon install right Brad. It would have to be after unpacking and running the first time.

Assuming the xml file is unpacked from the Railo/Lucee jars on first run, I assume it would need to happen somewhere on first run. Let’s put in a ticket and ask Denny. Shouldn’t be too hard to set a default password. I know the CLI version has a different default error template so there might already be an easy way to override the password in the CLI as well. And note, this would only affect the context of Railo/Lucee that the CLI runs on. I’m 99% sure the embedded server has its own context.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I would be all for commandbox as the default password.

Exactamundo Brad-- it would only be for the CLI context, and we're
already doing something in that area for the custom error page.

If someone puts a ticket in I'll take a look at it when I take a look at
fixing the error template for Lucee.

And "commandbox" seems like a fine default password, unless I hear
otherwise.

-Den

Done

https://ortussolutions.atlassian.net/browse/COMMANDBOX-222

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com