VRFS-2548 : Config-ize location of jamtracks python tool

This commit is contained in:
Steven Miers 2014-12-29 15:05:19 -06:00
parent bbee617c4b
commit bb298dd6b9
4 changed files with 12 additions and 5 deletions

View File

@ -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|

View File

@ -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

View File

@ -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'

1
web/jt_metadata.json Normal file
View File

@ -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"}