diff options
author | Marcel Amirault <4155490-marcel.amirault@users.noreply.gitlab.com> | 2021-04-30 16:48:37 +0300 |
---|---|---|
committer | Marcel Amirault <4155490-marcel.amirault@users.noreply.gitlab.com> | 2021-04-30 16:48:37 +0300 |
commit | 9211258b3e94b6fbcbe532cc108409138f5309c1 (patch) | |
tree | 51142eaf890bdd0c704aa857e06b97fe03d4392d | |
parent | abb509c176825e4ad924d6a4fee3bc63f70649f0 (diff) | |
parent | c461707a73ec550ebb1b3724317b882150badb53 (diff) |
Merge branch 'ap-feature-flags-rakefile' into 'master'
Check if feature flags symlinks exist
See merge request gitlab-org/gitlab-docs!1746
-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 |