Sha256: c5c00047858bf7a4965497f35165e5c7afcd6d0e3afc9ea9ecd37b85ca84a3f8
Contents?: true
Size: 1.93 KB
Versions: 1
Compression:
Stored size: 1.93 KB
Contents
class GitUrl def self.build url if(url.kind_of?(Array)) url.each{|u| GitUrl.build u} else puts "build #{url}" work_dir = get_work_dir(url) puts "work_dir #{work_dir}" if(!Dir.exists?(work_dir)) puts "git clone #{url} #{work_dir}" puts `git clone #{url} #{work_dir}` end Dir.chdir(work_dir) do puts "git pull (#{work_dir})" puts `git pull` puts "rake #{work_dir}" puts `rake` end end end def self.build_tags url local_dir = Environment.dev_root + "/build/" + get_relative_dir(url) if(!Dir.exists?(local_dir)) puts `git clone #{url} #{local_dir}` end Dir.chdir(local_dir) do puts `git pull` stags = `git tag`.gsub('\r','') tags = stags.split('\n') tags.each{|tag| build_tag url tags.strip } end end def self.build_tag url, tag puts "build #{url} #{tag}" work_dir = get_build_dir_tag(url,tag) puts "work_dir #{work_dir}" if(!Dir.exists?(work_dir)) puts "git clone -b #{tag} --single-branch --depth 1 #{url} #{work_dir}" puts `git clone -b #{tag} --single-branch --depth 1 #{url} #{work_dir}` Dir.chdir(work_dir) do puts "rake #{work_dir}" puts `rake` end end end def self.get_work_dir url Environment.dev_root + "/work/" + get_relative_dir(url) end def self.get_build_dir_tag url, tag Environment.dev_root + "/build/" + get_relative_dir(url) + "-#{tag}" end def self.get_relative_dir url url.gsub('http://','').gsub('https://','').gsub('.git','') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dev-2.1.115 | lib/base/giturl.rb |