summaryrefslogtreecommitdiff
path: root/config/helpers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 09:08:42 +0000
commitb76ae638462ab0f673e5915986070518dd3f9ad3 (patch)
treebdab0533383b52873be0ec0eb4d3c66598ff8b91 /config/helpers
parent434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff)
downloadgitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'config/helpers')
-rw-r--r--config/helpers/is_jh_env.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/config/helpers/is_jh_env.js b/config/helpers/is_jh_env.js
new file mode 100644
index 00000000000..10251d3166e
--- /dev/null
+++ b/config/helpers/is_jh_env.js
@@ -0,0 +1,16 @@
+const fs = require('fs');
+const path = require('path');
+const IS_EE = require('./is_ee_env');
+
+const ROOT_PATH = path.resolve(__dirname, '../..');
+
+// The `FOSS_ONLY` is always `string` or `nil`
+// Thus the nil or empty string will result
+// in using default value: false
+//
+// The behavior needs to be synchronised with
+// lib/gitlab.rb: Gitlab.jh?
+// Since IS_EE already satisifies the conditions of not being a FOSS_ONLY.
+// const isFossOnly = JSON.parse(process.env.FOSS_ONLY || 'false');
+const isEEOnly = JSON.parse(process.env.EE_ONLY || 'false');
+module.exports = IS_EE && !isEEOnly && fs.existsSync(path.join(ROOT_PATH, 'jh'));