Commit 8ee8e552 authored by jz143's avatar jz143

seperate web and signing worker...add missing file [untested code]

parent 4f61b801
class FetchedSignedIpaJob < ActiveJob::Base
queue_as :web
def perform(app_file_id)
# get corresponding app_file record
app_file = AppFile.find(app_file_id)
log = app_file.code_signing_log
begin
# get file to app_file.signed_ipa_location
log << "scp from sign:#{app_file.signed_ipa_path_on_signing_server} to #{app_file.signed_ipa_location}\n"
SSH::SCP.download!(Settings.signing_worker.host, Settings.signing_worker.user,
app_file.signed_ipa_path_on_signing_server, app_file.signed_ipa_location)
# remove remote file
log << "removing sign:#{File.dirname(app_file.signed_ipa_path_on_signing_server)}\n"
Net::SSH.start(Settings.signing_worker.host, Settings.signing_worker.user) do |ssh|
ssh.exec "rm -rf \"#{File.dirname(app_file.signed_ipa_path_on_signing_server)}\""
end
# remove user uploaded unsigned package to save space
log << "removing local, unsigned copy\n"
app_file.archive.destroy
rescue => e
app_file.download_to_web_failed!
log << "Fatal error: " << e.to_s << "\n"
ensure
end
end
end
class AddDownloadTokenToAppFile < ActiveRecord::Migration
def change
add_column :app_files, :download_token, :string
add_column :app_files, :signed_ipa_path_on_signing_server, :string
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment