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
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2021-04-27 09:36:10 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2021-04-27 09:36:10 +0300
commitc461707a73ec550ebb1b3724317b882150badb53 (patch)
tree5ec5237c03eff91915000e5aa01b98500a09215f /Rakefile
parent6504fc38c7b34c16109a3ba081542d8841768cae (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--Rakefile19
1 files changed, 18 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index d90044c9..fb5a8de4 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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