Class: Fastlane::Actions::SftpUploadAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/sftp/actions/sftp_upload.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorObject



36
37
38
# File 'lib/fastlane/plugin/sftp/actions/sftp_upload.rb', line 36

def self.author
  'oklimberg'
end

.available_optionsObject



32
33
34
# File 'lib/fastlane/plugin/sftp/actions/sftp_upload.rb', line 32

def self.available_options
  Sftp::Options.available_options_upload
end

.categoryObject



44
45
46
# File 'lib/fastlane/plugin/sftp/actions/sftp_upload.rb', line 44

def self.category
  :misc
end

.descriptionObject



24
25
26
# File 'lib/fastlane/plugin/sftp/actions/sftp_upload.rb', line 24

def self.description
  'upload files to a remote Server via SFTP'
end

.detailsObject



28
29
30
# File 'lib/fastlane/plugin/sftp/actions/sftp_upload.rb', line 28

def self.details
  "More information: https://github.com/oklimberg/fastlane-plugin-sftp/"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/fastlane/plugin/sftp/actions/sftp_upload.rb', line 40

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/fastlane/plugin/sftp/actions/sftp_upload.rb', line 8

def self.run(params)
  # sh 'bundle exec rubocop -D'
  FastlaneCore::PrintTable.print_values(config: params, mask_keys: [:server_password, :server_key, :server_key_passphrase], title: "SFTP Upload #{Sftp::VERSION} Summary")

  UI.success('SFTP Uploader running...')
  uploader = Sftp::Uploader.new(params)
  result = uploader.upload
  msg = 'Upload failed. Check out the error above.'
  UI.user_error!(msg) unless result
  UI.success('Finished the upload.')
end