fastlane-plugin-ftps 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +86 -0
- data/lib/fastlane/plugin/ftps/actions/ftps_action.rb +152 -0
- data/lib/fastlane/plugin/ftps/helper/ftps_helper.rb +12 -0
- data/lib/fastlane/plugin/ftps/version.rb +5 -0
- data/lib/fastlane/plugin/ftps.rb +16 -0
- metadata +146 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 50b6e2f305b3a12262c3194b8de7aba289a792eae6221d9cf4e33e871f6abf79
|
4
|
+
data.tar.gz: c286ce62005b2c1a58e4cf78edc4471888de31c571e421f5f486c54451ebd0e0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 848927bb0c4f340483983a2eb2bc9764610bcdcc1565d651853ad68647da537ef2d67779c9370f2af0c0c35438f3e254218db92e26e40e75b8de49394264ad93
|
7
|
+
data.tar.gz: 1e3767f03846c2e24301e4baff5a301d4f3c73b1e03914c0a0add81ce2097e4b7b38c6524588eff772086de45560b1f6ad4fe0c95ec2ee8c23a3d846769ac156
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Allan Vialatte <allan.vialatte@icloud.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
# ftp plugin
|
2
|
+
|
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)
|
5
|
+
|
6
|
+
## Getting Started
|
7
|
+
|
8
|
+
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-ftps`, add it to your project by running:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
fastlane add_plugin ftps
|
12
|
+
```
|
13
|
+
|
14
|
+
## About ftp
|
15
|
+
|
16
|
+
Simple FTPS plugins for Fastlane
|
17
|
+
|
18
|
+
Support Download and Upload
|
19
|
+
|
20
|
+
## Example
|
21
|
+
|
22
|
+
### Upload :
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
ftp(
|
26
|
+
host: 'ftp.domain.com',
|
27
|
+
username: 'my_name',
|
28
|
+
password: 'my_password',
|
29
|
+
upload: {
|
30
|
+
src: "./localFile",
|
31
|
+
dest:"/server/path/"
|
32
|
+
},
|
33
|
+
options: {
|
34
|
+
ssl: true,
|
35
|
+
port: ENV["FTP_PORT"],
|
36
|
+
}
|
37
|
+
)
|
38
|
+
```
|
39
|
+
|
40
|
+
### Download
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
ftp(
|
44
|
+
host: 'ftp.domain.com',
|
45
|
+
username: 'my_name',
|
46
|
+
password: 'my_password',
|
47
|
+
download: {
|
48
|
+
src: "/distant/server/path/file.md",
|
49
|
+
dest:"/localPath/file.md"
|
50
|
+
}
|
51
|
+
,
|
52
|
+
options: {
|
53
|
+
ssl: true,
|
54
|
+
port: ENV["FTP_PORT"],
|
55
|
+
}
|
56
|
+
)
|
57
|
+
```
|
58
|
+
|
59
|
+
## Run tests for this plugin
|
60
|
+
|
61
|
+
To run both the tests, and code style validation, run
|
62
|
+
|
63
|
+
````
|
64
|
+
rake
|
65
|
+
```
|
66
|
+
|
67
|
+
To automatically fix many of the styling issues, use
|
68
|
+
```
|
69
|
+
rubocop -a
|
70
|
+
```
|
71
|
+
|
72
|
+
## Issues and Feedback
|
73
|
+
|
74
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
75
|
+
|
76
|
+
## Troubleshooting
|
77
|
+
|
78
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.
|
79
|
+
|
80
|
+
## Using `fastlane` Plugins
|
81
|
+
|
82
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md).
|
83
|
+
|
84
|
+
## About `fastlane`
|
85
|
+
|
86
|
+
`fastlane` is the easiest way to automate building and releasing your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,152 @@
|
|
1
|
+
require 'net/ftp'
|
2
|
+
require 'ruby-progressbar'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class FtpsAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
|
9
|
+
if params[:upload]
|
10
|
+
FtpsAction.open(params, params[:upload][:dest])
|
11
|
+
FtpsAction.put(params)
|
12
|
+
end
|
13
|
+
|
14
|
+
if params[:download]
|
15
|
+
FtpsAction.get(params)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.open(params, folder)
|
20
|
+
ftp = Net::FTP.new(params[:host], params[:options])
|
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
|
34
|
+
end
|
35
|
+
end
|
36
|
+
ftp.close()
|
37
|
+
UI.success("FTP move in #{growing_path} on #{params[:host]}:#{params[:port]}")
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.put(params)
|
41
|
+
ftp = Net::FTP.new(params[:host], params[:options])
|
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
|
51
|
+
end
|
52
|
+
ftp.close()
|
53
|
+
UI.success("Successfully uploaded #{params[:upload][:src]}")
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.get(params)
|
57
|
+
ftp = Net::FTP.new(params[:host], params[:options])
|
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|
|
63
|
+
end
|
64
|
+
ftp.close()
|
65
|
+
UI.success("Successfully download #{params[:download][:dest]}")
|
66
|
+
end
|
67
|
+
|
68
|
+
#####################################################
|
69
|
+
# @!group Documentation
|
70
|
+
#####################################################
|
71
|
+
|
72
|
+
def self.description
|
73
|
+
"Upload and Download files via FTP"
|
74
|
+
end
|
75
|
+
|
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
|
81
|
+
|
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),
|
119
|
+
FastlaneCore::ConfigItem.new(key: :options,
|
120
|
+
short_option: "-O",
|
121
|
+
env_name: "FL_FTP_OPTIONS",
|
122
|
+
description: "options",
|
123
|
+
optional: true,
|
124
|
+
is_string: false,
|
125
|
+
type: Hash),
|
126
|
+
FastlaneCore::ConfigItem.new(key: :port,
|
127
|
+
short_option: "-P",
|
128
|
+
env_name: "FL_FTP_PORT",
|
129
|
+
description: "Port",
|
130
|
+
optional: true,
|
131
|
+
default_value: 21,
|
132
|
+
is_string: false,
|
133
|
+
type: Integer),
|
134
|
+
]
|
135
|
+
end
|
136
|
+
|
137
|
+
def self.output
|
138
|
+
end
|
139
|
+
|
140
|
+
def self.return_value
|
141
|
+
end
|
142
|
+
|
143
|
+
def self.authors
|
144
|
+
["Allan Vialatte, Rafał Dziuryk"]
|
145
|
+
end
|
146
|
+
|
147
|
+
def self.is_supported?(platform)
|
148
|
+
true
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class FtpsHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::FtpsHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the ftps plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/ftp/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Ftp
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::Ftp.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-ftps
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rafał Dziuryk
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-01-04 00:00:00.000000000 Z
|
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'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: fastlane
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.2.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.2.0
|
111
|
+
description:
|
112
|
+
email: rafal.dziuryk@appvinio.com
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files: []
|
116
|
+
files:
|
117
|
+
- LICENSE
|
118
|
+
- README.md
|
119
|
+
- lib/fastlane/plugin/ftps.rb
|
120
|
+
- lib/fastlane/plugin/ftps/actions/ftps_action.rb
|
121
|
+
- lib/fastlane/plugin/ftps/helper/ftps_helper.rb
|
122
|
+
- lib/fastlane/plugin/ftps/version.rb
|
123
|
+
homepage: https://github.com/rafaldziuryk/fastlane-ftps-plugin
|
124
|
+
licenses:
|
125
|
+
- MIT
|
126
|
+
metadata: {}
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubygems_version: 3.0.3.1
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: Simple ftp upload and download for Fastlane
|
146
|
+
test_files: []
|