[file-store-4] some fixes

This commit is contained in:
Alexander Machehin 2012-11-05 16:38:29 +06:00
parent 03cb24fb9f
commit 0246b1f5bf
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
pwd=`pwd` pwd=`pwd`
cd $1 cd $1
git filter-branch --tree-filter "$pwd/bin/file-store $2" --prune-empty --tag-name-filter cat -- --all git filter-branch --tree-filter "$pwd/bin/file-store.rb $2" --prune-empty --tag-name-filter cat -- --all
cd .. cd ..

View File

@ -1,8 +1,9 @@
namespace :project do namespace :project do
desc "Truncate blobs from git repo" desc "Truncate blobs from git repo"
task :remove_archives => :environment do task :remove_archives => :environment do
raise 'Need set GIT_PROJECTS_DIR' if ENV['GIT_PROJECTS_DIR'].blank? #raise 'Need set GIT_PROJECTS_DIR' if ENV['GIT_PROJECTS_DIR'].blank?
raise 'Need special "rosa_system" user' raise 'Need set CLONE_PATH' if ENV['CLONE_PATH'].blank?
raise 'Need special "rosa_system" user' unless User.where(:uname => 'rosa_system').exists?
token = User.find_by_uname('rosa_system').authentication_token token = User.find_by_uname('rosa_system').authentication_token
abf_existing_log = File.open "#{ENV['CLONE_PATH']}/projects_with_abf_yml.log", 'w' abf_existing_log = File.open "#{ENV['CLONE_PATH']}/projects_with_abf_yml.log", 'w'
@ -27,7 +28,7 @@ namespace :project do
time = Time.now time = Time.now
path = "#{ENV['CLONE_PATH'].chomp('/')}/repos/#{project.name_with_owner}" path = "#{ENV['CLONE_PATH'].chomp('/')}/repos/#{project.name_with_owner}"
FileUtils.rm_rf path FileUtils.rm_rf path
project_path = "#{ENV['GIT_PROJECTS_DIR']}/#{project.name_with_owner}/.git" project_path = project.path#"#{ENV['GIT_PROJECTS_DIR']}/#{project.name_with_owner}/.git"
system "git clone --mirror #{project_path} #{path}/.git" system "git clone --mirror #{project_path} #{path}/.git"
archives_exists = false archives_exists = false
Dir.chdir(path) do Dir.chdir(path) do