diff --git a/packages/cluster/src/common.js b/packages/cluster/src/common.js index a2125ef0..a1b289a0 100644 --- a/packages/cluster/src/common.js +++ b/packages/cluster/src/common.js @@ -155,7 +155,9 @@ module.exports.makeEnvironment = cfg => { DHIS2_CORE_VERSION: cfg.dhis2Version, DHIS2_CORE_DB_VERSION: cfg.dbVersion, DHIS2_CORE_PORT: cfg.port, - DHIS2_CORE_CONFIG: cfg.dhis2Config, + } + if (cfg.dhis2Config) { + env.DHIS2_CORE_CONFIG = cfg.dhis2Config } reporter.debug('Runtime environment\n', env) diff --git a/packages/cluster/tests/setup-environment.js b/packages/cluster/tests/setup-environment.js index 42b3107e..5da1fd7c 100644 --- a/packages/cluster/tests/setup-environment.js +++ b/packages/cluster/tests/setup-environment.js @@ -27,7 +27,6 @@ test('build runtime environment based on defaults', async function(t) { DHIS2_CORE_VERSION: 'dev', DHIS2_CORE_DB_VERSION: 'dev', DHIS2_CORE_PORT: defaults.port, - DHIS2_CORE_CONFIG: undefined, } t.deepEqual(actual, expected, 'default environment') @@ -57,7 +56,6 @@ test('build runtime environment based on args', async function(t) { DHIS2_CORE_VERSION: '2.33', DHIS2_CORE_DB_VERSION: '2.32', DHIS2_CORE_PORT: 8233, - DHIS2_CORE_CONFIG: undefined, } t.deepEqual(actual, expected, 'args environment') @@ -90,7 +88,6 @@ test('build runtime environment based on mixed args and config', async function( DHIS2_CORE_VERSION: 'master', DHIS2_CORE_DB_VERSION: 'dev', DHIS2_CORE_PORT: 8233, - DHIS2_CORE_CONFIG: undefined, } t.deepEqual(actual, expected, 'args and config environment') @@ -124,7 +121,6 @@ test('build runtime environment based on mixed args, cache, config and defaults' DHIS2_CORE_VERSION: 'dev', DHIS2_CORE_DB_VERSION: 'dev', DHIS2_CORE_PORT: 8233, - DHIS2_CORE_CONFIG: undefined, } t.deepEqual(actual, expected, 'merged environment') @@ -165,7 +161,6 @@ test('build runtime environment based on mixed args, cache, config, custom per-c DHIS2_CORE_VERSION: 'apa', DHIS2_CORE_DB_VERSION: 'dev', DHIS2_CORE_PORT: 9999, - DHIS2_CORE_CONFIG: undefined, } t.deepEqual(actual, expected, 'merged environment')