Class: Fastlane::Actions::DotgpgEnvironmentAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/dotgpg_environment.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, output, return_value, sh, step_text

Class Method Details

.authorsObject



36
37
38
# File 'lib/fastlane/actions/dotgpg_environment.rb', line 36

def self.authors
  ["simonlevy5"]
end

.available_optionsObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fastlane/actions/dotgpg_environment.rb', line 23

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :dotgpg_file,
                                 env_name: "DOTGPG_FILE",
                                 description: "Path to your gpg file",
                                 default_value: Dir["dotgpg/*.gpg"].last,
                                 optional: false,
                                 verify_block: proc do |value|
                                   UI.user_error!("Dotgpg file '#{File.expand_path(value)}' not found") unless File.exist?(value)
                                 end)
  ]
end

.descriptionObject



15
16
17
# File 'lib/fastlane/actions/dotgpg_environment.rb', line 15

def self.description
  "Reads in production secrets set in a dotgpg file and puts them in ENV"
end

.detailsObject



19
20
21
# File 'lib/fastlane/actions/dotgpg_environment.rb', line 19

def self.details
  "More information about dotgpg can be found at https://github.com/ConradIrwin/dotgpg"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/fastlane/actions/dotgpg_environment.rb', line 40

def self.is_supported?(platform)
  true
end

.run(options) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/fastlane/actions/dotgpg_environment.rb', line 7

def self.run(options)
  Actions.verify_gem!('dotgpg')
  require 'dotgpg/environment'

  UI.message("Reading secrets from #{options[:dotgpg_file]}")
  Dotgpg::Environment.new(options[:dotgpg_file]).apply
end