Sha256: 0066ce659470fed598b39af01b60d18b4e70a737ef09b365f57d27fbd768b966

Contents?: true

Size: 1.54 KB

Versions: 36

Compression:

Stored size: 1.54 KB

Contents

require 'shellwords'

module Fastlane
  module Actions
    class ImportCertificateAction < Action
      def self.run(params)
        command = "security import #{params[:certificate_path].shellescape} -k ~/Library/Keychains/#{params[:keychain_name].shellescape}"
        command << " -P #{params[:certificate_password].shellescape}" if params[:certificate_password]
        command << " -T /usr/bin/codesign"
        command << " -T /usr/bin/security"

        Fastlane::Actions.sh command, log: false
      end

      def self.description
        "Import certificate from inputfile into a keychain"
      end

      def self.available_options
        [
          FastlaneCore::ConfigItem.new(key: :keychain_name,
                                       env_name: "KEYCHAIN_NAME",
                                       description: "Keychain name into which item",
                                       optional: false),
          FastlaneCore::ConfigItem.new(key: :certificate_path,
                                       env_name: "",
                                       description: "Path to certificate",
                                       optional: false),
          FastlaneCore::ConfigItem.new(key: :certificate_password,
                                       env_name: "",
                                       description: "Certificate password",
                                       optional: true)
        ]
      end

      def self.authors
        ["gin0606"]
      end

      def self.is_supported?(platform)
        true
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
fastlane-1.37.0 lib/fastlane/actions/import_certificate.rb
fastlane-1.36.4 lib/fastlane/actions/import_certificate.rb
fastlane-1.36.3 lib/fastlane/actions/import_certificate.rb
fastlane-1.36.2 lib/fastlane/actions/import_certificate.rb
fastlane-1.36.1 lib/fastlane/actions/import_certificate.rb
fastlane-1.36.0 lib/fastlane/actions/import_certificate.rb
fastlane-1.35.0 lib/fastlane/actions/import_certificate.rb
fastlane-1.34.0 lib/fastlane/actions/import_certificate.rb
fastlane-1.33.6 lib/fastlane/actions/import_certificate.rb
fastlane-1.33.5 lib/fastlane/actions/import_certificate.rb
fastlane-1.33.4 lib/fastlane/actions/import_certificate.rb
fastlane-1.33.3 lib/fastlane/actions/import_certificate.rb
fastlane-1.33.2 lib/fastlane/actions/import_certificate.rb
fastlane-1.33.1 lib/fastlane/actions/import_certificate.rb
fastlane-1.33.0 lib/fastlane/actions/import_certificate.rb
fastlane-1.32.4 lib/fastlane/actions/import_certificate.rb
fastlane-1.32.3 lib/fastlane/actions/import_certificate.rb
fastlane-1.32.2 lib/fastlane/actions/import_certificate.rb
fastlane-1.32.1 lib/fastlane/actions/import_certificate.rb
fastlane-1.32.0 lib/fastlane/actions/import_certificate.rb