3

When working with a ColdFusion server you can access the CFIDE/administrator to set config values, which update the cfusion/lib/ xml files (e.g. neo-runtime.xml, neo-mail.xml, etc.)

I'd like to automate a deployment process that includes setting these administrator values so that I don't have to log in and manually set them for each new box that shares settings. I'm unsure of the best way to go about it.

Some thoughts I had are:

  1. Replacing the full files with ones containing my custom settings. I've done this for local development, but it may not be an ideal method due to CF hot-fixes potentially adding/removing/changing attributes.
  2. A script to read the wddx xml file and replace the attribute values. I'm having trouble finding information about how to do this method.

Has anyone done anything like this before? Or does anyone have any recommendations on how to best go about this?

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Nick RB
  • 133
  • 6
  • 3
    What version of ColdFusion? ColdFusion 2016 and 2018 include a Command Line Interface (CLI) that let's you interact with the server settings. [Read the documentation here](https://helpx.adobe.com/coldfusion/using/command-line-interface.html) OR maybe package up your ColdFusion settings in a ColdFusion Archive then deploy to your new server - [Deploy ColdFusion applications](https://helpx.adobe.com/coldfusion/configuring-administering/deploying-coldfusion-applications.html#PackagingapplicationsinCARfiles) – Miguel-F Aug 03 '20 at 18:52
  • We've got CF11 and CF2018 boxes but new deployments should (hopefully) only be CF2018. I've never worked with the CLI, but it looks promising. I'll take a deeper look into both options. Thank you – Nick RB Aug 03 '20 at 19:38
  • 1
    If you come up with a good solution, you should write it up as an answer that way the next person can learn what you learned. – James A Mohler Aug 03 '20 at 20:06

3 Answers3

4

At one company, we checked all the neo-*.xml files into source control, with a set for each environment Devs only had access to the dev settings and we could deploy a local development environment with all the correct settings for new employees quickly.

but it may not be an ideal method due to CF hot-fixes potentially adding/removing/changing attributes.

You have to keep up with those changes and migrate each environment appropriately.

While I was there, we upgraded from 8 to 9, 9 to 11 and from 11 to 2016. Environments would have to be mixed as it took time to verify the applications worked with each new version of CF. Each server got their correct XML files for that environment and scripts would copy updates as needed. We had something like 55 servers in production running 8 instances each, so this scaled well.

Adrian J. Moreno
  • 14,350
  • 1
  • 37
  • 44
1

There is a very usefull tool developed by Ortus Solutions for this kind of automatizations called cfconfig that can be installed with their commandbox command line utility. This tool isn't only capable of setting configurations of the administrator: It is also capable of exporting/importing settings to a json file (cfconfig.json). It might be what you need.

Here is the link to their docs https://cfconfig.ortusbooks.com/introduction/getting-started-guide

AndreasRu
  • 1,053
  • 8
  • 14
1

CFConfig worked perfectly for my needs. I marked @AndreasRu answer as accepted for introducing me to that tool! I'm just adding this response with some additional detail for posterity.

  1. Install CommandBox as part of deployment script
  2. Install CFConfig as part of deployment script
  3. Use CFConfig to export a config.json file from an existing box that will share settings with the new deployment. Store this json file in source control for each type/env of box.
  4. Use CFConfig to import the config.json as part of deployment script

Here's a simple example of what this looks like on debian

# Installs CommandBox
curl -fsSl https://downloads.ortussolutions.com/debs/gpg | apt-key add -
echo "deb https://downloads.ortussolutions.com/debs/noarch /" | tee -a /etc/apt/sources.list.d/commandbox.list
apt-get update && apt-get install apt-transport-https commandbox

# Installs CFConfig module
box install commandbox-cfconfig

# Import config settings
box cfconfig import from=/<path-to-config>/config.json to=/opt/ColdFusion/cfusion/ toFormat=adobe@11.0.19
Nick RB
  • 133
  • 6
  • Thanks for adding and completing the answer. It will help others for sure. Glad I could give some sort of direction to your question. – AndreasRu Aug 31 '20 at 22:20