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 <axilleas@axilleas.me>2017-03-14 14:14:20 +0300
committerAchilleas Pipinellis <axilleas@axilleas.me>2017-03-14 14:14:20 +0300
commitf2b00f10e9f24d154583bd4341e08ee28e5496f2 (patch)
treeeac5e0f0418224fd4a59c49bc1461696cf2dbdef /Rakefile
parentc339ef07b217017a385ddea875dc686c5c6683b6 (diff)
Build the docs site using the latest stable branches
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile22
1 files changed, 16 insertions, 6 deletions
diff --git a/Rakefile b/Rakefile
index bd363c8d..e40454b7 100644
--- a/Rakefile
+++ b/Rakefile
@@ -41,7 +41,6 @@ task :pull_repos do
dirs.each do |dir|
unless "#{dir}".start_with?("tmp")
-
puts "\n=> Making an empty #{dir}"
FileUtils.mkdir("#{dir}") unless File.exist?("#{dir}")
end
@@ -50,22 +49,33 @@ task :pull_repos do
products.each do |product|
temp_dir = File.join(product['dirs']['temp_dir'])
+ case product['slug']
+ when 'ce'
+ branch = ENV['BRANCH_CE'] || 'master'
+ when 'ee'
+ branch = ENV['BRANCH_EE'] || 'master'
+ when 'omnibus'
+ branch = ENV['BRANCH_OMNIBUS'] || 'master'
+ when 'runner'
+ branch = ENV['BRANCH_RUNNER'] || 'master'
+ end
+
if !File.exist?(temp_dir) || Dir.entries(temp_dir).length.zero?
- puts "\n=> Cloning #{product['repo']} into #{temp_dir}\n"
+ puts "\n=> Cloning #{product['repo']} #{branch} into #{temp_dir}\n"
- `git clone #{product['repo']} #{temp_dir} --depth 1 --branch master`
+ `git clone #{product['repo']} #{temp_dir} --depth 1 --branch #{branch}`
elsif File.exist?(temp_dir) && !Dir.entries(temp_dir).length.zero?
- puts "\n=> Pulling master of #{product['repo']}\n"
+ puts "\n=> Pulling #{branch} of #{product['repo']}\n"
# Enter the temporary directory and return after block is completed.
FileUtils.cd(temp_dir) do
# Update repository from master.
- `git pull origin master`
+ `git pull origin #{branch}`
end
else
puts "This shouldn't happen"
end
-
+
temp_doc_dir = File.join(product['dirs']['temp_dir'], product['dirs']['doc_dir'], '.')
destination_dir = File.join(product['dirs']['dest_dir'])
puts "\n=> Copying #{temp_doc_dir} into #{destination_dir}\n"