mirror of
https://github.com/Icinga/icinga-docs-tools.git
synced 2025-07-21 12:54:23 +02:00
Fix cloning and checkout mechanism
This commit is contained in:
parent
23f21fe42f
commit
d37721a3b3
@ -2,7 +2,7 @@
|
||||
require 'optparse'
|
||||
require 'fileutils'
|
||||
require 'yaml'
|
||||
require 'git'
|
||||
require 'rugged'
|
||||
|
||||
options = {}
|
||||
OptionParser.new { |opts|
|
||||
@ -30,16 +30,14 @@ OptionParser.new { |opts|
|
||||
|
||||
def clone_and_update_project(target, clone_target, git, ref)
|
||||
if !File.directory?(clone_target)
|
||||
puts "Cloning to #{target} to #{clone_target} ..."
|
||||
puts "Cloning to #{target}: #{ref} to #{clone_target} ..."
|
||||
FileUtils.mkdir_p(clone_target)
|
||||
repo = Git.clone(git, clone_target)
|
||||
Rugged::Repository.clone_at(git, clone_target, {:checkout_branch => ref})
|
||||
else
|
||||
repo = Git.open(clone_target)
|
||||
repo.fetch()
|
||||
puts "Cleaning up #{clone_target}"
|
||||
FileUtils::rm_rf(clone_target)
|
||||
clone_and_update_project(target, clone_target, git, ref)
|
||||
end
|
||||
|
||||
puts "Checkout #{target} ref '#{ref}'"
|
||||
repo.branch(ref).checkout
|
||||
end
|
||||
|
||||
def build_page_index(full_docs_dir, project_docs_dir)
|
||||
|
@ -4,7 +4,7 @@ source_dir: '/Users/bsheqa/git/github/icinga/icinga-docs-tools/www/source'
|
||||
site_dir: '/Users/bsheqa/git/github/icinga/icinga-docs-tools/www/html'
|
||||
project:
|
||||
git: 'https://github.com/Icinga/icinga2.git'
|
||||
ref: 'support/v2.7'
|
||||
ref: 'support/2.7'
|
||||
target: 'icinga2'
|
||||
docs_dir: 'doc'
|
||||
latest: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user