[file-store-4] modify uploading script
This commit is contained in:
parent
e64398f82b
commit
03cb24fb9f
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
pwd=`pwd`
|
||||
command="$(pwd)/calc_sha_help $2"
|
||||
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 ..
|
||||
|
|
|
@ -11,8 +11,7 @@ old_sources = if File.exist? abf_yml
|
|||
MAX_SIZE = 2 * 1024 * 1024 # 2.megabytes
|
||||
url = 'http://file-store.rosalinux.ru/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, pass)
|
||||
rclient = RestClient::Resource.new(url, :user => ARGF.argv[0]) # user auth token
|
||||
|
||||
Dir.glob("*.{tar\.bz2,tar\.gz,bz2,rar,gz,tar,tbz2,tgz,zip,Z,7z}").uniq.sort.each do |file|
|
||||
begin
|
||||
|
|
|
@ -2,7 +2,9 @@ namespace :project do
|
|||
desc "Truncate blobs from git repo"
|
||||
task :remove_archives => :environment do
|
||||
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'
|
||||
projects = if uname = ENV['OWNER']
|
||||
owner = User.find_by_uname(uname) || Group.find_by_uname(uname)
|
||||
|
@ -40,7 +42,7 @@ namespace :project do
|
|||
abf_existing_log.puts message
|
||||
`rm -rf #{path}`
|
||||
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 !!!
|
||||
|
|
Loading…
Reference in New Issue