From 3808a05d808039344b0aa3e2d25582ece3f50b38 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@keylocation.sg>
Date: Sun, 15 Jan 2017 08:52:21 +0100
Subject: [PATCH] Allow config file specification in env

---
 app/config/file.js | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/app/config/file.js b/app/config/file.js
index 4c5f567ab4..bbba78f68d 100644
--- a/app/config/file.js
+++ b/app/config/file.js
@@ -1,14 +1,23 @@
 const logger = require('winston');
 
+let configFile = process.env.RENOVATE_CONFIG_FILE || 'config';
+if (!isPathAbsolute(configFile)) {
+  configFile = `../../${configFile}`;
+}
+
 let config = {};
 try {
-  // eslint-disable-next-line import/no-unresolved,global-require
-  config = require('../../config');
+  // eslint-disable-next-line global-require,import/no-dynamic-require
+  config = require(configFile);
 } catch (err) {
   // Do nothing
-  logger.verbose('No custom config found');
+  logger.verbose('Could not locate config file');
 }
 
 logger.debug(`File config = ${JSON.stringify(config)}`);
 
 module.exports = config;
+
+function isPathAbsolute(path) {
+  return /^(?:\/|[a-z]+:\/\/)/.test(path);
+}
-- 
GitLab