diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2021-04-27 09:36:10 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2021-04-27 09:36:10 +0300 |
commit | c461707a73ec550ebb1b3724317b882150badb53 (patch) | |
tree | 5ec5237c03eff91915000e5aa01b98500a09215f /Rakefile | |
parent | 6504fc38c7b34c16109a3ba081542d8841768cae (diff) |
Check if feature flags symlinks exist
- Check if feature flags symlinks exist and abort
otherwise.
- Echo to the user when the flags YAML file is
generated.
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -112,6 +112,20 @@ end desc 'Generates _data/feature_flags.yaml' task :generate_feature_flags do + + feature_flags_dir = File.join('tmp', 'feature_flags') + feature_flags_ee_dir = File.join('tmp', 'feature_flags-ee') + + unless Dir.exist?(feature_flags_dir) + abort('The feature flags directory does not exist. + See https://gitlab.com/gitlab-org/gitlab-docs/-/blob/master/README.md#generate-the-feature-flag-tables') + end + + unless Dir.exist?(feature_flags_ee_dir) + abort('The feature flags EE directory does not exist. + See https://gitlab.com/gitlab-org/gitlab-docs/-/blob/master/README.md#generate-the-feature-flag-tables') + end + paths = { 'GitLab Community Edition and Enterprise Edition' => File.join('tmp', 'feature_flags', '**', '*.yml'), 'GitLab Enterprise Edition only' => File.join('tmp', 'feature_flags-ee', '**', '*.yml') @@ -129,7 +143,10 @@ task :generate_feature_flags do end end - File.write(File.join('content', '_data', 'feature_flags.yaml'), feature_flags.to_yaml) + feature_flags_yaml = File.join('content', '_data', 'feature_flags.yaml') + + puts "Generating #{feature_flags_yaml}" + File.write(feature_flags_yaml, feature_flags.to_yaml) end namespace :release do |