Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>How to tune the configuration for apps/frameworks on CloudBees will vary from framework-to-framework. The basic technique you need to use is:</p> <ol> <li>Figure out how you would tell your app to load this alternate config file when running locally</li> <li>Figure out how to make CloudBees do the equivalent when launching your application</li> </ol> <h2>Loading an Alternative Play Configuration File</h2> <p>Based on the <a href="http://www.playframework.com/documentation/2.0/Configuration">Configuration</a> or <a href="http://www.playframework.com/documentation/2.0/ProductionConfiguration">ProductionConfiguration</a> docs on the Play2 site, it looks like you can specify a -Dconfig.resource=CONF_FILENAME system property to tell Play2 to load your alternative configuration:</p> <blockquote> <p>Using -Dconfig.resource <br><br> It will search for an alternative configuration file in the application classpath (you usually provide these alternative configuration files into your application conf/ directory before packaging).</p> <pre><code> $ start -Dconfig.resource=prod.conf </code></pre> </blockquote> <p>Based on this, we now know HOW to tell your runtime framework (Play) to load an alternate configuration file. Next, we need to figure out make CloudBees do the same.</p> <h2>Setting System Properties on CloudBees</h2> <p>The <a href="http://developer.cloudbees.com/bin/view/RUN/BeesSDK">CloudBees SDK</a> includes command line options for <a href="http://developer.cloudbees.com/bin/view/RUN/Configuration+Parameters">setting configuration parameters</a> for your app that will be injected as system properties (for JVM-based apps) during startup. This can be done by specifying a -Pname=value option on the app:deploy command line or you can use the config:set command instead.</p> <p>Since you are using the an SBT plugin to deploy your app (which may not support this feature), it would probably be easiest to use the SDK's config:set command:</p> <pre><code>bees config:set -a APPID config.resource=mrm.conf </code></pre> <p><em>Note: you'll need to restart your app for this config param to be applied</em></p> <p>If I understand the Play2 docs correctly, this should cause Play to load the configuration file in conf/mrm.conf.</p> <h2>A Simpler Solution? - Just override the key</h2> <p>Based on your example, I noticed that you seem to be trying to only override the value of a specific configuration key in your default application.conf file...</p> <p>Looking at the Play <a href="http://www.playframework.com/documentation/2.0/ProductionConfiguration">ProductionConfiguration</a> docs, it seems like overriding the entire config file may be overkill, and that you could instead simply specify the value you want to override using a system property. The CloudBees SDK <a href="http://developer.cloudbees.com/bin/view/RUN/Configuration+Parameters">config:set</a> command is designed exactly for this use-case and provides an easy way for you to inject custom app parameters. Java-based stacks on CloudBees will inject these parameters as System Properties, which means they should be picked up automatically by your Play app.</p> <p>Based on the example override in your mrm.conf file, the following should work:</p> <pre><code>bees config:set -a APPID cloudbees.applicationId=mrm </code></pre> <p>If this works properly for you, I'll add some of this info back to the <a href="http://developer.cloudbees.com/bin/view/RUN/Playframework">CloudBees Play</a> docs.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload