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

generic.rb « helpers « lib - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6dfcaf96dd139e91dc4b25650eff8f9236303170 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

module Nanoc::Helpers
  module Generic
    #
    # Check if NANOC_ENV is set to production
    #
    def production?
      ENV['NANOC_ENV'] == 'production'
    end

    #
    # Check if NANOC_ENV is set to production and the branch is the default one.
    # For things that should only be built in production of the default branch.
    # Sometimes we don't want things to be deployed into the stable branches,
    # which they are considered production.
    #
    def production_and_default_branch?
      ENV['NANOC_ENV'] == 'production' and ENV['CI_DEFAULT_BRANCH'] == ENV['CI_COMMIT_BRANCH']
    end

    #
    # Used when bundling gitlab-docs with Omnibus
    #
    def omnibus?
      ENV['NANOC_ENV'] == 'omnibus'
    end
  end
end