Set up Run Mode in CQ
Run modes allow you to tune your CQ instance for a specific purpose; for example author, publish or development. This is done by defining collections of configuration parameters for each run mode. A basic set is applied for all run modes, additional sets are each tuned to the purpose of your specific environment.
All configuration settings are stored in the one repository and activated by setting the Run Mode.
You can also create environment specific run mode such as,
- author, development
- publish, test
- author, intranet, us
- as required...
- To set up standard run mode Use the naming convention:
- To set up environment specific run mode there are two methods,
Method 1: Through <cq-installation-dir>/crx-quickstart/launchpad/sling.properties
Add the following properties (following example is for author, test, uk):
In above case config.author.test.uk will get picked up (Or whatever with maximum match)
Method 2: Through <cq-installation-dir>/crx-quickstart/launchpad/sling.properties and system property (In start script):
sling.jcrinstall.folder.name.regexp=.*/(install|config)? #<------ In sling.properties file
-Dsling.run.modes=publish,prod,us #<----- In start script or system property
In above case config.publish.prod.us will get picked up (Or whatever with maximum match)
Configuration values for the run modes are saved in the repository. You can store all configurations in one repository as the run mode is indicated by a suffix on the folder name; for example:
- config, applicable for all run modes
- config.author, used in author run mode
- config.publish, used in publish run mode
- config.<standard-run-mode>.<env-specific-mode>, used in the applicable run mode
- From jar file
- From Sling property
- From System property
NOTE: From CQ5.5 there is no need to set sling property regexp to set up run mode. Setting enviornment specific run mode through system property or sling property will be enough to decide run mode.