Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Environment specific properties

Geert edited this page Jun 8, 2017 · 1 revision

When you start a new project, you can use "ml init" to create the basic configuration files. This consists of

  • $dir/deploy/build.properties
  • $dir/deploy/ml-config.xml

build.properties has a set of project specific overrides for the default values from $dir/deploy/default.properties. You will want to change some of these values, specifically the app-name value and probably the password for the MarkLogic user used for deploying. You will probably want to change the ports.

Multiple Environments

As you set up multiple environments, you will find there are differences between them. For each environment (local, dev, prod), you can create a separate properties file (local.properties, dev.properties, prod.properties). In these files, copy just the values you want to change. For instance, your prod environment almost certainly has a different password than your local instance, so copy the password attribute to prod.properties and set the correct value there.

Adding an environment

Suppose local, dev, and prod aren't enough and you'd like to add more environments. Open up deploy/build.properties and add this line:

environments=local,dev,prod,your-env-here

You also need to add a {env}-server property. If your environment is "int":

environments=local,dev,prod,int
int-server=intserver.my-domain.com

Specific values

The individual settings in the build.properties file have descriptive comments to clarify what those values are for. Note that you can use "${basedir}" and "${app-name}" in these values. basedir automatically refers to the directory in which the framework lives (parent of deploy, src). app-name is based on the app-name setting in the properties file, so you can use a setting to control other settings. For instance:

app-name=my-app
content-db=${app-name}-content

This will result in a database called my-app-content.

Pipelines

Roxy Deployer can create your MarkLogic CPF pipeline configurations for you. You simply need to configure them in the $roxy/deploy/pipelines-config.xml file.

To get started you need to create the xml file. Do so using Roxy Deployer:

> ml initcpf

Edit $roxy/deploy/pipelines-config.xml to your liking.

Before you can install the CPF code made sure your application has been bootstrapped and your modules have been deployed:

> ml local bootstrap
> ml local deploy modules

Now you can install your CPF

> ml local deploy cpf

ml-config.xml

This file defines the details of the application servers, databases and forests. The format is very similar to the how MarkLogic defines its own configuration files, but with certain override values to bring in information from your .properties files.

The most likely reason for editing this file is to add element- and attribute-range-indexes. You will find a sample element-range-index definition in the ml-config.xml file, commented out.