-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from elegion/feature/certs
Feature/certs
- Loading branch information
Showing
9 changed files
with
86 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
lane :test do | ||
eln | ||
eln_certs_get | ||
eln_certs_update | ||
end | ||
|
||
lane :test_params do | ||
eln_certs_get( | ||
eln_certs_provision_profile_name_list: "Some App Name:com.team.some-app,Some Extension Name:com.team.some-extension" | ||
) | ||
eln_certs_update( | ||
eln_certs_provision_profile_name_list: "Some App Name:com.team.some-app,Some Extension Name:com.team.some-extension" | ||
) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,52 @@ | ||
require 'fastlane/action' | ||
require_relative '../helper/eln_helper' | ||
require_relative 'eln_certs' | ||
|
||
module Fastlane | ||
module Actions | ||
|
||
class ElnCertsGetAction < ElnCertsAction | ||
class ElnCertsGetAction < Action | ||
def self.run(params) | ||
|
||
provisions_pairs = Helper::CertsHelper.validate_provisions(params) | ||
provisions_pairs.each { | ||
|key, value| | ||
|
||
list = params[:eln_certs_provision_profile_name_list] | ||
provisions_pairs = Helper::CertsHelper.validate_provisions(list) | ||
provisions_pairs.each do |key, value| | ||
other_action.match( | ||
profile_name: key, | ||
app_identifier: value, | ||
readonly: true, | ||
force_for_new_devices: false, | ||
force: false | ||
) | ||
} | ||
end | ||
end | ||
|
||
def self.authors | ||
["[email protected]"] | ||
end | ||
|
||
def self.description | ||
"E-Legion" | ||
"Gets private certificate and provision profile" | ||
end | ||
|
||
def self.return_value | ||
# If your method provides a return value, you can describe here what it does | ||
end | ||
|
||
def self.details | ||
# Optional: | ||
"Plugin for good start" | ||
end | ||
|
||
def self.available_options | ||
[ | ||
FastlaneCore::ConfigItem.new(key: :eln_certs_provision_profile_name_list, | ||
env_name: "ELN_CERTS_PROVISION_PROFILE_NAME_LIST", | ||
description: "Provisions and identifiers to create. Provision and identifiers should be separated by colon, pairs should be separated by comma, e.g \"profile name_1:identifier_1,profile name_2:identifier_2\"", | ||
optional: false, | ||
type: String, | ||
verify_block: proc do |value| | ||
UI.user_error("Certificates and provisions are empty!") unless value && !value.empty? | ||
end) | ||
] | ||
end | ||
|
||
def self.is_supported?(platform) | ||
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example) | ||
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform | ||
# | ||
# [:ios, :mac, :android].include?(platform) | ||
true | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,53 @@ | ||
require 'fastlane/action' | ||
require_relative '../helper/eln_helper' | ||
require_relative 'eln_certs' | ||
|
||
module Fastlane | ||
module Actions | ||
|
||
class ElnCertsUpdateAction < ElnCertsAction | ||
class ElnCertsUpdateAction < Action | ||
def self.run(params) | ||
provisions_pairs = Helper::CertsHelper.validate_provisions(params) | ||
list = params[:eln_certs_provision_profile_name_list] | ||
provisions_pairs = Helper::CertsHelper.validate_provisions(list) | ||
other_action.register_devices | ||
provisions_pairs.each { | ||
|key, value| | ||
|
||
provisions_pairs.each do |key, value| | ||
other_action.match( | ||
profile_name: key, | ||
app_identifier: value, | ||
readonly: true, | ||
force_for_new_devices: false, | ||
force: false | ||
) | ||
} | ||
end | ||
end | ||
|
||
def self.authors | ||
["[email protected]"] | ||
end | ||
|
||
def self.description | ||
"E-Legion" | ||
"Adds new devices and force updates provision profiles" | ||
end | ||
|
||
def self.return_value | ||
# If your method provides a return value, you can describe here what it does | ||
end | ||
|
||
def self.details | ||
# Optional: | ||
"Plugin for good start" | ||
end | ||
|
||
def self.available_options | ||
[ | ||
FastlaneCore::ConfigItem.new(key: :eln_certs_provision_profile_name_list, | ||
env_name: "ELN_CERTS_PROVISION_PROFILE_NAME_LIST", | ||
description: "Provisions and identifiers to create. Provision and identifiers should be separated by colon, pairs should be separated by comma, e.g \"profile name_1:identifier_1,profile name_2:identifier_2\"", | ||
optional: false, | ||
type: String, | ||
verify_block: proc do |value| | ||
UI.user_error("Certificates and provisions are empty!") unless value && !value.empty? | ||
end) | ||
] | ||
end | ||
|
||
def self.is_supported?(platform) | ||
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example) | ||
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform | ||
# | ||
# [:ios, :mac, :android].include?(platform) | ||
true | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
describe Fastlane::Helper::CertsHelper do | ||
describe '#run' do | ||
it "valid" do | ||
expect(Fastlane::Helper::CertsHelper.validate_provisions("some:value")).to eql([["some", "value"]]) | ||
expect(Fastlane::Helper::CertsHelper.validate_provisions("some:value, some:value2")).to eql([["some", "value"], ["some", "value2"]]) | ||
expect(Fastlane::Helper::CertsHelper.validate_provisions("some:value, some: value2")).to eql([["some", "value"], ["some", "value2"]]) | ||
expect(Fastlane::Helper::CertsHelper.validate_provisions("some spaced value :value, some: value2")).to eql([["some spaced value", "value"], ["some", "value2"]]) | ||
end | ||
it "fails" do | ||
expect(Fastlane::UI).to receive(:error) | ||
Fastlane::Helper::CertsHelper.validate_provisions("some:value,some") | ||
end | ||
end | ||
end |