fastlane-plugin-ftp 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -0
- data/lib/fastlane/plugin/ftp/actions/ftp_action.rb +111 -104
- data/lib/fastlane/plugin/ftp/version.rb +1 -1
- metadata +19 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 916da35f9e907730547f06ae4c49c140419250865e7fa6a42489c4b5f7df5f20
|
4
|
+
data.tar.gz: f8498362699f0394872662590adc738dc0ddf853de5d0c5da2b5eb56f62fc25c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a82a85af69057161b7320605702ab260b9f99deddd73b49351e5dbc0776efaf20a75d03cb893a8ba9c98c6020e51ca6e57e39418e6fcdf530b536cc0dc39b183
|
7
|
+
data.tar.gz: f7fbb9011c7497700f98ebc84c07b30474112abffef48735966a8561061ea0be44f92dc972d976f310d8c7830996ed20e6ad247d9c449f21f8c8eacac0a9e4eb
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# ftp plugin
|
2
2
|
|
3
3
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-ftp)
|
4
|
+
[![Build Status](https://travis-ci.org/PoissonBallon/fastlane-ftp-plugin.svg?branch=master)](https://travis-ci.org/PoissonBallon/fastlane-ftp-plugin)
|
4
5
|
|
5
6
|
## Getting Started
|
6
7
|
|
@@ -1,139 +1,146 @@
|
|
1
|
+
require 'net/ftp'
|
2
|
+
require 'ruby-progressbar'
|
3
|
+
|
1
4
|
module Fastlane
|
2
5
|
module Actions
|
3
6
|
class FtpAction < Action
|
4
7
|
def self.run(params)
|
5
|
-
|
8
|
+
|
6
9
|
if params[:upload]
|
7
10
|
FtpAction.open(params, params[:upload][:dest])
|
8
11
|
FtpAction.put(params)
|
9
12
|
end
|
13
|
+
|
10
14
|
if params[:download]
|
11
15
|
FtpAction.get(params)
|
12
16
|
end
|
13
17
|
end
|
14
18
|
|
15
19
|
def self.open(params, folder)
|
16
|
-
Net::FTP.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
ftp = Net::FTP.new
|
21
|
+
ftp.connect(params[:host], params[:port])
|
22
|
+
ftp.login(params[:username], params[:password])
|
23
|
+
ftp.passive = true
|
24
|
+
UI.success("Successfully Login to #{params[:host]}:#{params[:port]}")
|
25
|
+
parts = folder.split("/")
|
26
|
+
growing_path = ""
|
27
|
+
parts.each do |part|
|
28
|
+
growing_path += "/" + part
|
29
|
+
begin
|
30
|
+
ftp.chdir(growing_path)
|
31
|
+
rescue
|
32
|
+
ftp.mkdir(part) unless File.exist?(growing_path)
|
33
|
+
retry
|
29
34
|
end
|
30
|
-
UI.success("FTP move in #{growing_path} on #{params[:host]}")
|
31
|
-
ftp.close
|
32
35
|
end
|
36
|
+
ftp.close()
|
37
|
+
UI.success("FTP move in #{growing_path} on #{params[:host]}:#{params[:port]}")
|
33
38
|
end
|
34
39
|
|
35
40
|
def self.put(params)
|
36
|
-
Net::FTP.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
print "\r"
|
47
|
-
print "%3i %" % percent
|
48
|
-
print "["
|
49
|
-
finished.downto(1) { |n| print "=" }
|
50
|
-
print ">"
|
51
|
-
not_finished.downto(1) { |n| print " " }
|
52
|
-
print "]"
|
53
|
-
end
|
54
|
-
print "\n"
|
55
|
-
UI.success("Successfully uploaded #{params[:upload][:src]}")
|
56
|
-
ftp.close
|
41
|
+
ftp = Net::FTP.new
|
42
|
+
progressbar = ProgressBar.create(:format => '%a |%b>>%i| %p%% %t', :starting_at => 0)
|
43
|
+
ftp.connect(params[:host], params[:port])
|
44
|
+
ftp.login(params[:username], params[:password])
|
45
|
+
ftp.passive = true
|
46
|
+
ftp.chdir(params[:upload][:dest])
|
47
|
+
filesize = File.size(params[:upload][:src])
|
48
|
+
progressbar.total = filesize
|
49
|
+
ftp.putbinaryfile(params[:upload][:src], params[:upload][:src].split("/").last) do |data|
|
50
|
+
progressbar.progress += data.size
|
57
51
|
end
|
52
|
+
ftp.close()
|
53
|
+
UI.success("Successfully uploaded #{params[:upload][:src]}")
|
58
54
|
end
|
59
55
|
|
60
56
|
def self.get(params)
|
61
|
-
Net::FTP.
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
57
|
+
ftp = Net::FTP.new
|
58
|
+
ftp.passive = true
|
59
|
+
ftp.connect(params[:host], params[:port])
|
60
|
+
ftp.login(params[:username], params[:password])
|
61
|
+
UI.success("Successfully Login to #{params[:host]}:#{params[:port]}")
|
62
|
+
ftp.getbinaryfile(params[:download][:src], params[:download][:dest]) do |data|
|
67
63
|
end
|
68
|
-
|
64
|
+
ftp.close()
|
65
|
+
UI.success("Successfully download #{params[:download][:dest]}")
|
66
|
+
end
|
69
67
|
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
#####################################################
|
69
|
+
# @!group Documentation
|
70
|
+
#####################################################
|
73
71
|
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
def self.description
|
73
|
+
"Upload and Download files via FTP"
|
74
|
+
end
|
77
75
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
76
|
+
def self.details
|
77
|
+
# Optional:
|
78
|
+
# this is your chance to provide a more detailed description of this action
|
79
|
+
"Transfer files via FTP, and create recursively folder for upload action"
|
80
|
+
end
|
83
81
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
]
|
122
|
-
end
|
82
|
+
def self.available_options
|
83
|
+
[
|
84
|
+
FastlaneCore::ConfigItem.new(key: :username,
|
85
|
+
short_option: "-u",
|
86
|
+
env_name: "FL_FTP_USERNAME",
|
87
|
+
description: "Username",
|
88
|
+
is_string: true),
|
89
|
+
FastlaneCore::ConfigItem.new(key: :password,
|
90
|
+
short_option: "-p",
|
91
|
+
env_name: "FL_FTP_PASSWORD",
|
92
|
+
description: "Password",
|
93
|
+
optional: false,
|
94
|
+
is_string: true),
|
95
|
+
FastlaneCore::ConfigItem.new(key: :host,
|
96
|
+
short_option: "-H",
|
97
|
+
env_name: "FL_FTP_HOST",
|
98
|
+
description: "Hostname",
|
99
|
+
is_string: true),
|
100
|
+
FastlaneCore::ConfigItem.new(key: :folder,
|
101
|
+
short_option: "-f",
|
102
|
+
env_name: "FL_FTP_FOLDER",
|
103
|
+
description: "repository",
|
104
|
+
is_string: true),
|
105
|
+
FastlaneCore::ConfigItem.new(key: :upload,
|
106
|
+
short_option: "-U",
|
107
|
+
env_name: "FL_FTP_UPLOAD",
|
108
|
+
description: "Upload",
|
109
|
+
optional: true,
|
110
|
+
is_string: false,
|
111
|
+
type: Hash),
|
112
|
+
FastlaneCore::ConfigItem.new(key: :download,
|
113
|
+
short_option: "-D",
|
114
|
+
env_name: "FL_FTP_DOWNLOAD",
|
115
|
+
description: "Download",
|
116
|
+
optional: true,
|
117
|
+
is_string: false,
|
118
|
+
type: Hash),
|
123
119
|
|
124
|
-
|
125
|
-
|
120
|
+
FastlaneCore::ConfigItem.new(key: :port,
|
121
|
+
short_option: "-P",
|
122
|
+
env_name: "FL_FTP_PORT",
|
123
|
+
description: "Port",
|
124
|
+
optional: true,
|
125
|
+
default_value: 21,
|
126
|
+
is_string: false,
|
127
|
+
type: Integer),
|
128
|
+
]
|
129
|
+
end
|
126
130
|
|
127
|
-
|
128
|
-
|
131
|
+
def self.output
|
132
|
+
end
|
129
133
|
|
130
|
-
|
131
|
-
|
132
|
-
end
|
134
|
+
def self.return_value
|
135
|
+
end
|
133
136
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
+
def self.authors
|
138
|
+
["Allan Vialatte"]
|
139
|
+
end
|
140
|
+
|
141
|
+
def self.is_supported?(platform)
|
142
|
+
true
|
137
143
|
end
|
138
144
|
end
|
139
145
|
end
|
146
|
+
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-ftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allan Vialatte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ruby-progressbar
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: pry
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +100,14 @@ dependencies:
|
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 2.2.0
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 2.2.0
|
97
111
|
description:
|
98
112
|
email: allan.vialatte@icloud.com
|
99
113
|
executables: []
|
@@ -125,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
139
|
- !ruby/object:Gem::Version
|
126
140
|
version: '0'
|
127
141
|
requirements: []
|
128
|
-
|
129
|
-
rubygems_version: 2.5.1
|
142
|
+
rubygems_version: 3.0.3
|
130
143
|
signing_key:
|
131
144
|
specification_version: 4
|
132
145
|
summary: Simple ftp upload and download for Fastlane
|