Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2021-04-20 14:03:09 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2021-04-26 11:56:49 +0300
commit1c92127f186205d3ce985dd50ed203d20d28aacf (patch)
treecfce4872e875ae198e701b2cffbe89b66ba3c49b /lib
parent93396cb5ed66de6f3ada206cfc9243846086343c (diff)
Add helper that checks the CI_PROJECT_NAME
Check if CI_PROJECT_NAME is 'gitlab-docs', or nil which implies local development. This can be used to skip portions that we don't want to render in one of the upstream products.
Diffstat (limited to 'lib')
-rw-r--r--lib/helpers/generic.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/helpers/generic.rb b/lib/helpers/generic.rb
index 564118e8..c9254368 100644
--- a/lib/helpers/generic.rb
+++ b/lib/helpers/generic.rb
@@ -37,5 +37,14 @@ module Nanoc::Helpers
ENV['CI_COMMIT_REF_NAME']
end
end
+
+ #
+ # Check if CI_PROJECT_NAME is 'gitlab-docs', or nil which implies
+ # local development. This can be used to skip portions that we
+ # don't want to render in one of the upstream products.
+ #
+ def gitlab_docs_or_local?
+ ENV['CI_PROJECT_NAME'] == 'gitlab-docs' or ENV['CI_PROJECT_NAME'].nil?
+ end
end
end