Method: Xcode::Deploy::Ftp#deploy

Defined in:
lib/xcode/deploy/ftp.rb

#deployObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/xcode/deploy/ftp.rb', line 27

def deploy
  WebAssets.generate @builder, @base_url do |dir|
    puts "Connecting to #{@remote_host} with username #{@username}"
    Net::FTP.open(@host, @username, @password) do |ftp|
      begin
        puts "Creating folder #{remote_installation_path}"
        ftp.mkdir(remote_installation_path)
      rescue Net::FTPError
        puts "It looks like the folder is already there."
      end

      puts "Changing to remote folder #{remote_installation_path}"
      files = ftp.chdir(remote_installation_path)

      Dir["#{dir}/*"].each do |f|
        filename = File.basename(f)
        puts "Uploading #{filename}"
        ftp.putbinaryfile(f, filename, 1024)
      end

      filename = File.basename("#{@builder.ipa_path}")
      puts "Uploading #{filename}"
      ftp.putbinaryfile("#{@builder.ipa_path}", filename, 1024)
    end
  end
end