[file-store-4] modify uploading script

This commit is contained in:
Alexander Machehin 2012-11-02 23:45:40 +06:00
parent e64398f82b
commit 03cb24fb9f
3 changed files with 6 additions and 6 deletions

View File

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

View File

@ -11,8 +11,7 @@ old_sources = if File.exist? abf_yml
MAX_SIZE = 2 * 1024 * 1024 # 2.megabytes MAX_SIZE = 2 * 1024 * 1024 # 2.megabytes
url = 'http://file-store.rosalinux.ru/api/v1/file_stores.json' url = 'http://file-store.rosalinux.ru/api/v1/file_stores.json'
#url = 'http://localhost:3001/api/v1/file_stores.json' #url = 'http://localhost:3001/api/v1/file_stores.json'
user, pass = ARGF.argv[0] || 'CENSORED', ARGF.argv[1] || 'CENSORED' # FIXME rclient = RestClient::Resource.new(url, :user => ARGF.argv[0]) # user auth token
rclient = RestClient::Resource.new(url, user, pass)
Dir.glob("*.{tar\.bz2,tar\.gz,bz2,rar,gz,tar,tbz2,tgz,zip,Z,7z}").uniq.sort.each do |file| Dir.glob("*.{tar\.bz2,tar\.gz,bz2,rar,gz,tar,tbz2,tgz,zip,Z,7z}").uniq.sort.each do |file|
begin begin

View File

@ -2,7 +2,9 @@ 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 set CLONE_PATH' if ENV['CLONE_PATH'].blank? raise 'Need special "rosa_system" user'
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'
projects = if uname = ENV['OWNER'] projects = if uname = ENV['OWNER']
owner = User.find_by_uname(uname) || Group.find_by_uname(uname) owner = User.find_by_uname(uname) || Group.find_by_uname(uname)
@ -40,7 +42,7 @@ namespace :project do
abf_existing_log.puts message abf_existing_log.puts message
`rm -rf #{path}` `rm -rf #{path}`
elsif archives_exists.present? elsif archives_exists.present?
system "bin/calc_sha #{path} #{ENV['CLONE_PATH']}/archives" # FIXME change filename system "bin/calc_sha #{path} #{token}" # FIXME change filename
##### #####
# This is dangerous !!! # This is dangerous !!!