diff --git a/README.md b/README.md index fd18b17..47cc309 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,13 @@ The functionallity is currently limited to the options described below. The plug https://github.com/Microsoft/code-push/blob/master/cli/README.md#access-keys ``` -code_push_login(access_key: YOURSECRETACCESSKEY) +code_push_login(token: YOURSECRETACCESSKEY) ``` Options: Key | Description | Env Var | Default ------------- | ------------- | ------------- | ------------- -access_key | Access Key for CodePush Login | CODE_PUSH_ACCESS_KEY | +token | Access Key for CodePush Login | APP_CENTER_ACCESS_TOKEN | enforce | Enforce logout before login | | false "enforce" is usefull if you want to be assure that actions are done by a specfic "user" and not by the may current logged in user. Like in the context of a automatic build process @@ -44,7 +44,7 @@ Options: Key | Description | Env Var | Default ------------- | ------------- | ------------- | ------------- -app_name | CodePush app name for promoting to | FASTLANE_CODE_PUSH_APP_NAME | +app_name | CodePush app name for promoting to | FASTLANE_APPCENTER_APP_NAME | from | sourceDeploymentName | | Staging to | destDeploymentName | | Production dry_run | Print the command that would be run, and don't run it | | false @@ -62,7 +62,7 @@ code_push_release_cordova( Key | Description | Env Var | Default ------------- | ------------- | ------------- | ------------- -app_name | CodePush app name for releasing | FASTLANE_CODE_PUSH_APP_NAME | +app_name | CodePush app name for releasing | FASTLANE_APPCENTER_APP_NAME | execution_dir_path | Release React CLI command execution dir path. Set to project root when you execute fastlane in a diffrent dir than package.json stays | | ./ platform | Platform for releasing to | | android deployment | Deployment name for releasing to | | Staging @@ -85,9 +85,8 @@ code_push_release_react( Key | Description | Env Var | Default ------------- | ------------- | ------------- | ------------- -app_name | CodePush app name for releasing | FASTLANE_CODE_PUSH_APP_NAME | +app_name | CodePush app name for releasing | FASTLANE_APPCENTER_APP_NAME | execution_dir_path | Release React CLI command execution dir path. Set to project root when you execute fastlane in a diffrent dir than package.json stays | | ./ -platform | Platform for releasing to | | android deployment | Deployment name for releasing to | | Staging target_binary_version | Target binary version for example 1.0.1 | | mandatory | manadtory update or not | | true diff --git a/lib/fastlane/plugin/code_push/actions/code_push_login_action.rb b/lib/fastlane/plugin/code_push/actions/code_push_login_action.rb index 369eaa7..967919c 100644 --- a/lib/fastlane/plugin/code_push/actions/code_push_login_action.rb +++ b/lib/fastlane/plugin/code_push/actions/code_push_login_action.rb @@ -6,10 +6,10 @@ def self.run(params) Helper::CodePushLoginHelper.log_out end if Helper::CodePushLoginHelper.is_logged_in == false - if params[:access_key].instance_of?(String) - Helper::CodePushLoginHelper.log_in(params[:access_key]) + if params[:token].instance_of?(String) + Helper::CodePushLoginHelper.log_in(params[:token]) else - UI.user_error!("Provide parameter :access_key String") + UI.user_error!("Provide parameter :token String") end else UI.important "Login skipped !!! You were allready logged in. Logout first " @@ -17,11 +17,11 @@ def self.run(params) end def self.description - "CodePush login with accessKey" + "AppCenter login with accessKey" end def self.authors - ["Manuel Koch"] + ["Manuel Koch", "Hannan Shaik"] end def self.return_value @@ -35,11 +35,11 @@ def self.details def self.available_options [ - FastlaneCore::ConfigItem.new(key: :access_key, - env_name: "CODE_PUSH_ACCESS_KEY", + FastlaneCore::ConfigItem.new(key: :token, + env_name: "APP_CENTER_ACCESS_TOKEN", type: String, optional: false, - description: "Access Key for CodePush Login"), + description: "Access Key for AppCenter Login"), FastlaneCore::ConfigItem.new(key: :enforce, type: TrueClass, optional: true, diff --git a/lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb b/lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb index 8430d74..40eb604 100644 --- a/lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb +++ b/lib/fastlane/plugin/code_push/actions/code_push_promote_action.rb @@ -2,7 +2,7 @@ module Fastlane module Actions class CodePushPromoteAction < Action def self.run(params) - command = "code-push promote #{params[:app_name]} #{params[:from]} #{params[:to]}" + command = "appcenter codepush promote -a #{params[:app_name]} -s #{params[:from]} -d #{params[:to]}" if params[:dry_run] UI.message("Dry run!".red + " Would have run: " + command + "\n") else @@ -15,7 +15,7 @@ def self.description end def self.authors - ["Manuel Koch"] + ["Manuel Koch", "Hannan Shaik"] end def self.return_value @@ -28,7 +28,7 @@ def self.details def self.available_options [ FastlaneCore::ConfigItem.new(key: :app_name, - env_name: "FASTLANE_CODE_PUSH_APP_NAME", + env_name: "FASTLANE_APPCENTER_APP_NAME", type: String, optional: false, description: "CodePush app name for promoting to"), diff --git a/lib/fastlane/plugin/code_push/actions/code_push_release_cordova_action.rb b/lib/fastlane/plugin/code_push/actions/code_push_release_cordova_action.rb index 90ee040..8cd2b5e 100644 --- a/lib/fastlane/plugin/code_push/actions/code_push_release_cordova_action.rb +++ b/lib/fastlane/plugin/code_push/actions/code_push_release_cordova_action.rb @@ -3,8 +3,8 @@ module Actions class CodePushReleaseCordovaAction < Action def self.run(params) Dir.chdir "#{params[:execution_dir_path]}" do - command = "code-push release-cordova #{params[:app_name]} #{params[:platform]} -d #{params[:deployment]} "\ - "--des \"#{params[:description]}\" " + command = "appcenter codepush release-cordova -a #{params[:app_name]} -d #{params[:deployment]} "\ + "--description \"#{params[:description]}\" " if params[:mandatory] command += "-m " end @@ -42,7 +42,7 @@ def self.details def self.available_options [ FastlaneCore::ConfigItem.new(key: :app_name, - env_name: "FASTLANE_CODE_PUSH_APP_NAME", + env_name: "FASTLANE_APPCENTER_APP_NAME", type: String, optional: false, description: "CodePush app name for releasing"), diff --git a/lib/fastlane/plugin/code_push/actions/code_push_release_react_action.rb b/lib/fastlane/plugin/code_push/actions/code_push_release_react_action.rb index 121375e..7de7974 100644 --- a/lib/fastlane/plugin/code_push/actions/code_push_release_react_action.rb +++ b/lib/fastlane/plugin/code_push/actions/code_push_release_react_action.rb @@ -3,8 +3,8 @@ module Actions class CodePushReleaseReactAction < Action def self.run(params) Dir.chdir "#{params[:execution_dir_path]}" do - command = "code-push release-react #{params[:app_name]} #{params[:platform]} -d #{params[:deployment]} "\ - "--des \"#{params[:description]}\" " + command = "appcenter codepush release-react -a #{params[:app_name]} -d #{params[:deployment]} "\ + "--description \"#{params[:description]}\" " if params[:mandatory] command += "-m " end @@ -39,7 +39,7 @@ def self.description end def self.authors - ["Manuel Koch"] + ["Manuel Koch", "Hannan Shaik"] end def self.return_value @@ -54,7 +54,7 @@ def self.details def self.available_options [ FastlaneCore::ConfigItem.new(key: :app_name, - env_name: "FASTLANE_CODE_PUSH_APP_NAME", + env_name: "FASTLANE_APPCENTER_APP_NAME", type: String, optional: false, description: "CodePush app name for releasing"), @@ -63,11 +63,6 @@ def self.available_options optional: true, default_value: "./", description: "Release React CLI command execution dir"), - FastlaneCore::ConfigItem.new(key: :platform, - type: String, - optional: true, - default_value: "android", - description: "Platform for releasing to"), FastlaneCore::ConfigItem.new(key: :deployment, type: String, optional: true, diff --git a/lib/fastlane/plugin/code_push/helper/code_push_login_helper.rb b/lib/fastlane/plugin/code_push/helper/code_push_login_helper.rb index 3862f03..0da8527 100644 --- a/lib/fastlane/plugin/code_push/helper/code_push_login_helper.rb +++ b/lib/fastlane/plugin/code_push/helper/code_push_login_helper.rb @@ -1,20 +1,20 @@ module Fastlane module Helper class CodePushLoginHelper - def self.log_in(access_key) - Action.sh("code-push login --accessKey #{access_key}", print_command: false) + def self.log_in(token) + Action.sh("appcenter login --token #{token}", print_command: false) rescue - UI.user_error!("something went wrong during login with access key #{access_key}") + UI.user_error!("something went wrong during login with access key #{token}") end def self.log_out - Action.sh("code-push logout") + Action.sh("appcenter logout") rescue end def self.is_logged_in value = true begin - Action.sh("code-push whoami", false) + Action.sh("appcenter whoami", false) rescue value = false end