diff --git a/ruby/lib/jam_ruby/jam_tracks_manager.rb b/ruby/lib/jam_ruby/jam_tracks_manager.rb index 6594ffa9f..239601ada 100644 --- a/ruby/lib/jam_ruby/jam_tracks_manager.rb +++ b/ruby/lib/jam_ruby/jam_tracks_manager.rb @@ -17,8 +17,8 @@ module JamRuby def save_jam_track_right_jkz(jam_track_right) jam_track = jam_track_right.jam_track - py_root = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "..", "jamtracks")) - + #py_root = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "..", "jamtracks")) + py_root = APP_CONFIG.jamtracks_dir Dir.mktmpdir do |tmp_dir| jam_file_opts="" jam_track.jam_track_tracks.each do |jam_track_track| @@ -26,12 +26,11 @@ module JamRuby nm.gsub!(" ", "_") track_filename = File.join(tmp_dir, nm) track_url = jam_track_track.sign_url - puts "track_url: #{track_url}" copy_url_to_file(track_url, track_filename) copy_url_to_file(track_url, File.join(".", nm)) jam_file_opts << " -i '#{track_filename}+#{jam_track_track.part}'" end - puts "LS + " + `ls -la '#{tmp_dir}'` + #puts "LS + " + `ls -la '#{tmp_dir}'` sku=jam_track.id title=jam_track.name @@ -67,8 +66,8 @@ module JamRuby request = Net::HTTP::Get.new uri http.request request do |response| response_code = response.code.to_i - puts "Response from server was #{response_code} / #{response.message}" unless response_code >= 200 && response_code <= 299 + puts "Response from server was #{response_code} / #{response.message}" raise "bad status code: #{response_code}. body: #{response.body}" end response.read_body do |chunk| diff --git a/ruby/spec/support/utilities.rb b/ruby/spec/support/utilities.rb index 48a525fe0..380e63d0c 100644 --- a/ruby/spec/support/utilities.rb +++ b/ruby/spec/support/utilities.rb @@ -74,6 +74,10 @@ def app_config 0 # 0 seconds end + def jamtracks_dir + ENV['jamtracks_dir'] || File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "..", "jamtracks")) + end + def rabbitmq_host "localhost" end diff --git a/web/config/application.rb b/web/config/application.rb index 08d42e215..1aa82a05c 100644 --- a/web/config/application.rb +++ b/web/config/application.rb @@ -201,6 +201,9 @@ if defined?(Bundler) config.icecast_hardcoded_source_password = nil # generate a new password everytim. production should always use this value config.icecast_wait_after_reload = 5 # 5 seconds. a hack needed until VRFS-1043 + # Location of jamtracks python tool: + config.jamtracks_dir = ENV['JAMTRACKS_DIR'] || File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "jamtracks")) + config.email_alerts_alias = 'nobody@jamkazam.com' # should be used for 'oh no' server down/service down sorts of emails config.email_generic_from = 'nobody@jamkazam.com' config.email_smtp_address = 'smtp.sendgrid.net' diff --git a/web/jt_metadata.json b/web/jt_metadata.json new file mode 100644 index 000000000..252165875 --- /dev/null +++ b/web/jt_metadata.json @@ -0,0 +1 @@ +{"container_file": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/d20141229-34425-8fuxu7/jam-track-3.jkz", "coverart": null, "rsa_priv_file": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/d20141229-34425-8fuxu7/skey.pem", "tracks": [{"name": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/d20141229-34425-8fuxu7/lead_guitar.ogg", "trackName": "track_00"}], "rsa_pub_file": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/d20141229-34425-8fuxu7/pkey.pem", "jamktrack_info": "/var/folders/fk/0ckzmddd4tq28kxbb09vckbr0000gn/T/tmpJWp0T6"} \ No newline at end of file