fastlane-plugin-codepush 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +136 -0
- data/lib/fastlane/plugin/codepush.rb +16 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_login_action.rb +61 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_logout_action.rb +35 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_promote_action.rb +118 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_release_react_action.rb +198 -0
- data/lib/fastlane/plugin/codepush/helper/codepush_login_helper.rb +39 -0
- data/lib/fastlane/plugin/codepush/version.rb +5 -0
- metadata +177 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8e26afff641dff17301093b179c51d1252d205cb44f9c2c218e87659635f456b
|
4
|
+
data.tar.gz: d56c46c15d07c8ae3d15112d36168d5c7be9d63e2a760c20a85ccc34b60d13b5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8d734f1985bacef4e0c51365145db6dc3c229407580d369aaf5d86a5c03eb4c99213b0f53d665f59ec6cf829b50e6bf33e5aaeddc3ff7682a08a81754168ffec
|
7
|
+
data.tar.gz: 8695e7d7c108c50199337022829b8ee040e7956939dc4f1dca70a299b772cc42ca673374ff94ec8d0f4e97fbd767146c47f376f06c05784d14b6297ed965f953
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Pranit Harekar <pranitharekar@hotmail.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
# Fastlane CodePush plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-codepush)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-codepush`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin codepush
|
11
|
+
```
|
12
|
+
|
13
|
+
## About codepush
|
14
|
+
|
15
|
+
This is a Fastlane plugin for App Center CodePush service.
|
16
|
+
|
17
|
+
### List of available actions
|
18
|
+
|
19
|
+
#### 1. `codepush_login`
|
20
|
+
|
21
|
+
[Log in to App Center](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#account-management) to access CodePush service.
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
codepush_login
|
25
|
+
```
|
26
|
+
|
27
|
+
| Key | Description | Environment Variable | Default |
|
28
|
+
| ----------- | --------------------------------------------------------------------------------------------------- | ---------------------- | ------- |
|
29
|
+
| login_token | App center login token to access CodePush service, optional if ENV['APP_CENTER_LOGIN_TOKEN'] is set | APP_CENTER_LOGIN_TOKEN | |
|
30
|
+
| enforce | Enforce logout before login | | false |
|
31
|
+
|
32
|
+
#### 2. `codepush_logout`
|
33
|
+
|
34
|
+
[Log out of App Center](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#account-management)
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
codepush_logout
|
38
|
+
```
|
39
|
+
|
40
|
+
#### 3. `codepush_release_react`
|
41
|
+
|
42
|
+
CodePush [release-react](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#releasing-updates-react-native) action
|
43
|
+
|
44
|
+
This action lets you release React Native Javascript bundles to a specific CodePush deployment.
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
codepush_release_react(
|
48
|
+
app_name: "pharekar/MyAwesomeApp",
|
49
|
+
disable_duplicate_release_error: true
|
50
|
+
)
|
51
|
+
```
|
52
|
+
|
53
|
+
| Action | Description | Environment Variable | Default |
|
54
|
+
| ------------------------------- | ---------------------------------------------------------------------------------- | -------------------- | ------- |
|
55
|
+
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
56
|
+
| execution_dir_path | Release React CLI command execution dir path | | ./ |
|
57
|
+
| target_binary_version | Store/binary version of the app you are releasing the update for | | "\*" |
|
58
|
+
| deployment_name | Name of your deployment | | Staging |
|
59
|
+
| output_dir | Output directory | | |
|
60
|
+
| sourcemap_output | Relative path to where the generated JS bundle's source map file should be written | | |
|
61
|
+
| plist_file_prefix | File name prefix of the Info.plist file | | |
|
62
|
+
| plist_file | (iOS) Relative path to the Info.plist file | | |
|
63
|
+
| gradle_file | (Android) Relative path to the build.gradle file | | |
|
64
|
+
| description | An optional change log for the deployment | | |
|
65
|
+
| mandatory | Specify whether the update should be considered mandatory or not | | false |
|
66
|
+
| disabled | Specify whether the update should be downloadable by end users or not | | false |
|
67
|
+
| rollout_percentage | Percentage of users that should be eligible to receive this update | | |
|
68
|
+
| disable_duplicate_release_error | Specify whether duplicate release error should be disabled or not | | false |
|
69
|
+
| disable_telemetry | Specify whether telemetry should be disabled or not | | false |
|
70
|
+
| version | Version | | |
|
71
|
+
| private_key_path | Relative path to private key | | |
|
72
|
+
| entry_file | Relative path to the app's root/entry JavaScript file | | |
|
73
|
+
| development | Specify whether to generate an unminified, development JS bundle | | |
|
74
|
+
| bundle_name | File name that should be used for the generated JS bundle | | |
|
75
|
+
| dry_run | Print the command that would be run, and don't run it | | false |
|
76
|
+
|
77
|
+
#### 3. `codepush_promote`
|
78
|
+
|
79
|
+
CodePush [promote deployment](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#promoting-updates) action
|
80
|
+
|
81
|
+
This action lets you promote updates from a source deployment to a destination deployment.
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
codepush_promote(
|
85
|
+
app_name: "pharekar/MyAwesomeApp",
|
86
|
+
source_deployment_name: "Staging",
|
87
|
+
destination_deployment_name: "Production",
|
88
|
+
)
|
89
|
+
```
|
90
|
+
|
91
|
+
| Action | Description | Environment Variable | Default |
|
92
|
+
| ------------------------------- | ------------------------------------------------------------------------- | -------------------- | ------- |
|
93
|
+
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
94
|
+
| execution_dir_path | Promote CLI command execution dir path | | ./ |
|
95
|
+
| target_binary_version | Store/binary version of the app you are releasing the update for | | "\*" |
|
96
|
+
| source_deployment_name | Source deployment name | | |
|
97
|
+
| destination_deployment_name | Destination deployment name | | |
|
98
|
+
| description | An optional change log for the deployment | | |
|
99
|
+
| rollout_percentage | Percentage of users that should be eligible to receive this update | | |
|
100
|
+
| disable_duplicate_release_error | Specify whether duplicate release error should be disabled or not | | false |
|
101
|
+
| disable_telemetry | Specify whether telemetry should be disabled or not | | false |
|
102
|
+
| dry_run | Print the command that would be run, and don't run it | | false |
|
103
|
+
|
104
|
+
## Example
|
105
|
+
|
106
|
+
Check out the [example `Fastfile`](examples/ReactNative/fastlane/Fastfile) to see how to use this plugin.
|
107
|
+
|
108
|
+
## Run tests for this plugin
|
109
|
+
|
110
|
+
To run both the tests, and code style validation, run
|
111
|
+
|
112
|
+
```
|
113
|
+
rake
|
114
|
+
```
|
115
|
+
|
116
|
+
To automatically fix many of the styling issues, use
|
117
|
+
|
118
|
+
```
|
119
|
+
rubocop -a
|
120
|
+
```
|
121
|
+
|
122
|
+
## Issues and Feedback
|
123
|
+
|
124
|
+
For any other issues and feedback about this plugin, please submit it to this repository. Feel free to submit pull requests and improve test coverage.
|
125
|
+
|
126
|
+
## Troubleshooting
|
127
|
+
|
128
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
129
|
+
|
130
|
+
## Using _fastlane_ Plugins
|
131
|
+
|
132
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
133
|
+
|
134
|
+
## About _fastlane_
|
135
|
+
|
136
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/codepush/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Codepush
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::Codepush.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/codepush_login_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class CodepushLoginAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
if params[:enforce] == true
|
9
|
+
Helper::CodepushLoginHelper.logout
|
10
|
+
end
|
11
|
+
|
12
|
+
unless Helper::CodepushLoginHelper.is_logged_in
|
13
|
+
if params[:login_token].instance_of?(String)
|
14
|
+
Helper::CodepushLoginHelper.login(params[:login_token])
|
15
|
+
else
|
16
|
+
UI.user_error!('💥Missing login_token param')
|
17
|
+
UI.message!('Note: You can either pass login_token or set APP_CENTER_LOGIN_TOKEN environment variable')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.description
|
23
|
+
'CodePush login action'
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.authors
|
27
|
+
['Pranit Harekar']
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.return_value
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.details
|
34
|
+
'Log in to App Center to access CodePush service. You can pass token via login_token param or set APP_CENTER_LOGIN_TOKEN environment variable. If none were passed your action will be blocked with UI prompt.'
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.available_options
|
38
|
+
[
|
39
|
+
FastlaneCore::ConfigItem.new(
|
40
|
+
key: :login_token,
|
41
|
+
env_name: 'APP_CENTER_LOGIN_TOKEN',
|
42
|
+
description: "App center login token to access CodePush service, optional if ENV['APP_CENTER_LOGIN_TOKEN'] is set",
|
43
|
+
optional: false,
|
44
|
+
type: String
|
45
|
+
),
|
46
|
+
FastlaneCore::ConfigItem.new(
|
47
|
+
key: :enforce,
|
48
|
+
type: TrueClass,
|
49
|
+
optional: true,
|
50
|
+
default_value: false,
|
51
|
+
description: "Enforce logout before login"
|
52
|
+
)
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.is_supported?(platform)
|
57
|
+
true
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/codepush_login_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class CodepushLogoutAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
Helper::CodepushLoginHelper.logout
|
9
|
+
rescue
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.description
|
13
|
+
'CodePush logout action'
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.authors
|
17
|
+
['Pranit Harekar']
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.return_value
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.details
|
24
|
+
'Log out of App Center'
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.available_options
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.is_supported?(platform)
|
31
|
+
true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class CodepushPromoteAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
Dir.chdir(params[:execution_dir_path].to_s) do
|
8
|
+
command = "appcenter codepush promote "
|
9
|
+
|
10
|
+
## params
|
11
|
+
command += "-a #{params[:app_name]} "
|
12
|
+
command += "-t #{params[:target_binary_version]} " if params[:target_binary_version]
|
13
|
+
command += "-s #{params[:source_deployment_name]} " if params[:source_deployment_name]
|
14
|
+
command += "-d #{params[:destination_deployment_name]} " if params[:destination_deployment_name]
|
15
|
+
command += "-r #{params[:rollout_percentage]} " if params[:rollout_percentage]
|
16
|
+
command += '--disable-duplicate-release-error ' if params[:disable_duplicate_release_error]
|
17
|
+
command += '--disable-telemetry ' if params[:disable_telemetry]
|
18
|
+
command += "--description #{params[:description]} " if params[:description]
|
19
|
+
|
20
|
+
if params[:dry_run]
|
21
|
+
UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
|
22
|
+
else
|
23
|
+
sh(command.to_s)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.description
|
29
|
+
'CodePush promote action'
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.authors
|
33
|
+
['Pranit Harekar']
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.return_value
|
37
|
+
# If your method provides a return value, you can describe here what it does
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.details
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.available_options
|
44
|
+
[
|
45
|
+
FastlaneCore::ConfigItem.new(
|
46
|
+
key: :app_name,
|
47
|
+
env_name: "APP_CENTER_APP_NAME",
|
48
|
+
description: "Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set",
|
49
|
+
optional: false,
|
50
|
+
type: String
|
51
|
+
),
|
52
|
+
FastlaneCore::ConfigItem.new(
|
53
|
+
key: :execution_dir_path,
|
54
|
+
description: 'Promote CLI command execution dir path',
|
55
|
+
optional: true,
|
56
|
+
type: String,
|
57
|
+
default_value: "./"
|
58
|
+
),
|
59
|
+
FastlaneCore::ConfigItem.new(
|
60
|
+
key: :target_binary_version,
|
61
|
+
description: 'Store/binary version of the app you are releasing the update for',
|
62
|
+
optional: true,
|
63
|
+
type: String,
|
64
|
+
default_value: "\"*\""
|
65
|
+
),
|
66
|
+
FastlaneCore::ConfigItem.new(
|
67
|
+
key: :source_deployment_name,
|
68
|
+
description: 'Source deployment name',
|
69
|
+
optional: false,
|
70
|
+
type: String
|
71
|
+
),
|
72
|
+
FastlaneCore::ConfigItem.new(
|
73
|
+
key: :destination_deployment_name,
|
74
|
+
description: 'Destination deployment name',
|
75
|
+
optional: false,
|
76
|
+
type: String
|
77
|
+
),
|
78
|
+
FastlaneCore::ConfigItem.new(
|
79
|
+
key: :description,
|
80
|
+
description: "An optional change log for the deployment",
|
81
|
+
optional: true,
|
82
|
+
type: String
|
83
|
+
),
|
84
|
+
FastlaneCore::ConfigItem.new(
|
85
|
+
key: :rollout_percentage,
|
86
|
+
description: "Percentage of users that should be eligible to receive this update",
|
87
|
+
optional: true,
|
88
|
+
type: String
|
89
|
+
),
|
90
|
+
FastlaneCore::ConfigItem.new(
|
91
|
+
key: :disable_duplicate_release_error,
|
92
|
+
description: "Specify whether duplicate release error should be disabled or not",
|
93
|
+
optional: true,
|
94
|
+
is_string: false,
|
95
|
+
default_value: false
|
96
|
+
),
|
97
|
+
FastlaneCore::ConfigItem.new(
|
98
|
+
key: :disable_telemetry,
|
99
|
+
description: "Specify whether telemetry should be disabled or not",
|
100
|
+
optional: true,
|
101
|
+
is_string: false,
|
102
|
+
default_value: false
|
103
|
+
),
|
104
|
+
FastlaneCore::ConfigItem.new(
|
105
|
+
key: :dry_run,
|
106
|
+
description: "Print the command that would be run, and don't run it",
|
107
|
+
is_string: false,
|
108
|
+
default_value: false
|
109
|
+
)
|
110
|
+
]
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.is_supported?(platform)
|
114
|
+
true
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,198 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class CodepushReleaseReactAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
Dir.chdir(params[:execution_dir_path].to_s) do
|
8
|
+
command = "appcenter codepush release-react "
|
9
|
+
|
10
|
+
## params
|
11
|
+
command += "-a #{params[:app_name]} "
|
12
|
+
command += "-t #{params[:target_binary_version]} " if params[:target_binary_version]
|
13
|
+
command += "-d #{params[:deployment_name]} " if params[:deployment_name]
|
14
|
+
command += "-o #{params[:output_dir]} " if params[:output_dir]
|
15
|
+
command += "-s #{params[:sourcemap_output]} " if params[:sourcemap_output]
|
16
|
+
command += "--plist-file-prefix #{params[:plist_file_prefix]} " if params[:plist_file_prefix]
|
17
|
+
command += "-p #{params[:plist_file]} " if params[:plist_file]
|
18
|
+
command += "-g #{params[:gradle_file]} " if params[:gradle_file]
|
19
|
+
command += "--description #{params[:description]} " if params[:description]
|
20
|
+
command += '-m ' if params[:mandatory]
|
21
|
+
command += '-x ' if params[:disabled]
|
22
|
+
command += "-r #{params[:rollout_percentage]} " if params[:rollout_percentage]
|
23
|
+
command += '--disable-duplicate-release-error ' if params[:disable_duplicate_release_error]
|
24
|
+
command += '--disable-telemetry ' if params[:disable_telemetry]
|
25
|
+
command += "-v #{params[:version]} " if params[:version]
|
26
|
+
command += "-k #{params[:private_key_path]} " if params[:private_key_path]
|
27
|
+
command += "-e #{params[:entry_file]} " if params[:entry_file]
|
28
|
+
command += "--development " if params[:development]
|
29
|
+
command += "-b #{params[:bundle_name]} " if params[:bundle_name]
|
30
|
+
|
31
|
+
if params[:dry_run]
|
32
|
+
UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
|
33
|
+
else
|
34
|
+
sh(command.to_s)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.description
|
40
|
+
'CodePush release-react action'
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.authors
|
44
|
+
['Pranit Harekar']
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.return_value
|
48
|
+
# If your method provides a return value, you can describe here what it does
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.details
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.available_options
|
55
|
+
[
|
56
|
+
FastlaneCore::ConfigItem.new(
|
57
|
+
key: :app_name,
|
58
|
+
env_name: "APP_CENTER_APP_NAME",
|
59
|
+
description: "Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set",
|
60
|
+
optional: false,
|
61
|
+
type: String
|
62
|
+
),
|
63
|
+
FastlaneCore::ConfigItem.new(
|
64
|
+
key: :execution_dir_path,
|
65
|
+
description: 'Release React CLI command execution dir path',
|
66
|
+
optional: true,
|
67
|
+
type: String,
|
68
|
+
default_value: "./"
|
69
|
+
),
|
70
|
+
FastlaneCore::ConfigItem.new(
|
71
|
+
key: :target_binary_version,
|
72
|
+
description: 'Store/binary version of the app you are releasing the update for',
|
73
|
+
optional: true,
|
74
|
+
type: String,
|
75
|
+
default_value: "\"*\""
|
76
|
+
),
|
77
|
+
FastlaneCore::ConfigItem.new(
|
78
|
+
key: :deployment_name,
|
79
|
+
description: 'Deployment name',
|
80
|
+
optional: true,
|
81
|
+
type: String
|
82
|
+
),
|
83
|
+
FastlaneCore::ConfigItem.new(
|
84
|
+
key: :output_dir,
|
85
|
+
description: 'Output directory',
|
86
|
+
optional: true,
|
87
|
+
type: String
|
88
|
+
),
|
89
|
+
FastlaneCore::ConfigItem.new(
|
90
|
+
key: :sourcemap_output,
|
91
|
+
description: "Relative path to where the generated JS bundle's source map file should be written",
|
92
|
+
optional: true,
|
93
|
+
type: String
|
94
|
+
),
|
95
|
+
FastlaneCore::ConfigItem.new(
|
96
|
+
key: :plist_file_prefix,
|
97
|
+
description: "File name prefix of the Info.plist file",
|
98
|
+
optional: true,
|
99
|
+
type: String
|
100
|
+
),
|
101
|
+
FastlaneCore::ConfigItem.new(
|
102
|
+
key: :plist_file,
|
103
|
+
description: "Relative path to the Info.plist file",
|
104
|
+
optional: true,
|
105
|
+
type: String
|
106
|
+
),
|
107
|
+
FastlaneCore::ConfigItem.new(
|
108
|
+
key: :gradle_file,
|
109
|
+
description: "Relative path to the build.gradle file",
|
110
|
+
optional: true,
|
111
|
+
type: String
|
112
|
+
),
|
113
|
+
FastlaneCore::ConfigItem.new(
|
114
|
+
key: :description,
|
115
|
+
description: "An optional change log for the deployment",
|
116
|
+
optional: true,
|
117
|
+
type: String
|
118
|
+
),
|
119
|
+
FastlaneCore::ConfigItem.new(
|
120
|
+
key: :mandatory,
|
121
|
+
description: "Specify whether the update should be considered mandatory or not",
|
122
|
+
optional: true,
|
123
|
+
is_string: false,
|
124
|
+
default_value: false
|
125
|
+
),
|
126
|
+
FastlaneCore::ConfigItem.new(
|
127
|
+
key: :disabled,
|
128
|
+
description: "Specify whether the update should be downloadable by end users or not",
|
129
|
+
optional: true,
|
130
|
+
is_string: false,
|
131
|
+
default_value: false
|
132
|
+
),
|
133
|
+
FastlaneCore::ConfigItem.new(
|
134
|
+
key: :rollout_percentage,
|
135
|
+
description: "Percentage of users that should be eligible to receive this update",
|
136
|
+
optional: true,
|
137
|
+
type: String
|
138
|
+
),
|
139
|
+
FastlaneCore::ConfigItem.new(
|
140
|
+
key: :disable_duplicate_release_error,
|
141
|
+
description: "Specify whether duplicate release error should be disabled or not",
|
142
|
+
optional: true,
|
143
|
+
is_string: false,
|
144
|
+
default_value: false
|
145
|
+
),
|
146
|
+
FastlaneCore::ConfigItem.new(
|
147
|
+
key: :disable_telemetry,
|
148
|
+
description: "Specify whether telemetry should be disabled or not",
|
149
|
+
optional: true,
|
150
|
+
is_string: false,
|
151
|
+
default_value: false
|
152
|
+
),
|
153
|
+
FastlaneCore::ConfigItem.new(
|
154
|
+
key: :version,
|
155
|
+
description: "version",
|
156
|
+
optional: true,
|
157
|
+
type: String
|
158
|
+
),
|
159
|
+
FastlaneCore::ConfigItem.new(
|
160
|
+
key: :private_key_path,
|
161
|
+
description: "Relative path to private key",
|
162
|
+
optional: true,
|
163
|
+
type: String
|
164
|
+
),
|
165
|
+
FastlaneCore::ConfigItem.new(
|
166
|
+
key: :entry_file,
|
167
|
+
description: "Relative path to the app's root/entry JavaScript file",
|
168
|
+
optional: true,
|
169
|
+
type: String
|
170
|
+
),
|
171
|
+
FastlaneCore::ConfigItem.new(
|
172
|
+
key: :development,
|
173
|
+
description: "Specify whether to generate an unminified, development JS bundle",
|
174
|
+
optional: true,
|
175
|
+
is_string: false,
|
176
|
+
default_value: false
|
177
|
+
),
|
178
|
+
FastlaneCore::ConfigItem.new(
|
179
|
+
key: :bundle_name,
|
180
|
+
description: "File name that should be used for the generated JS bundle",
|
181
|
+
optional: true,
|
182
|
+
type: String
|
183
|
+
),
|
184
|
+
FastlaneCore::ConfigItem.new(
|
185
|
+
key: :dry_run,
|
186
|
+
description: "Print the command that would be run, and don't run it",
|
187
|
+
is_string: false,
|
188
|
+
default_value: false
|
189
|
+
)
|
190
|
+
]
|
191
|
+
end
|
192
|
+
|
193
|
+
def self.is_supported?(platform)
|
194
|
+
[:ios, :android].include?(platform)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'fastlane_core/ui/ui'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?('UI')
|
5
|
+
|
6
|
+
module Helper
|
7
|
+
class CodepushLoginHelper
|
8
|
+
def self.login(login_token)
|
9
|
+
Action.sh(
|
10
|
+
"appcenter login --token #{login_token}",
|
11
|
+
print_command: false
|
12
|
+
)
|
13
|
+
rescue StandardError
|
14
|
+
UI.user_error!(
|
15
|
+
"Something went wrong during App Center login!! Please ensure login token #{login_token} is correct"
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.logout
|
20
|
+
Action.sh("appcenter logout")
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.is_logged_in
|
24
|
+
logged_in = true
|
25
|
+
begin
|
26
|
+
Action.sh(
|
27
|
+
"appcenter profile list",
|
28
|
+
print_command: false
|
29
|
+
)
|
30
|
+
UI.message("User is already logged in")
|
31
|
+
rescue
|
32
|
+
logged_in = false
|
33
|
+
UI.message("User is not logged in")
|
34
|
+
end
|
35
|
+
logged_in
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-codepush
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pranit Harekar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_junit_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.49.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.49.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-require_tools
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: fastlane
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.141.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 2.141.0
|
139
|
+
description:
|
140
|
+
email: pranitharekar@hotmail.com
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- LICENSE
|
146
|
+
- README.md
|
147
|
+
- lib/fastlane/plugin/codepush.rb
|
148
|
+
- lib/fastlane/plugin/codepush/actions/codepush_login_action.rb
|
149
|
+
- lib/fastlane/plugin/codepush/actions/codepush_logout_action.rb
|
150
|
+
- lib/fastlane/plugin/codepush/actions/codepush_promote_action.rb
|
151
|
+
- lib/fastlane/plugin/codepush/actions/codepush_release_react_action.rb
|
152
|
+
- lib/fastlane/plugin/codepush/helper/codepush_login_helper.rb
|
153
|
+
- lib/fastlane/plugin/codepush/version.rb
|
154
|
+
homepage: https://github.com/Pranit-Harekar/fastlane-plugin-codepush
|
155
|
+
licenses:
|
156
|
+
- MIT
|
157
|
+
metadata: {}
|
158
|
+
post_install_message:
|
159
|
+
rdoc_options: []
|
160
|
+
require_paths:
|
161
|
+
- lib
|
162
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: '0'
|
172
|
+
requirements: []
|
173
|
+
rubygems_version: 3.0.6
|
174
|
+
signing_key:
|
175
|
+
specification_version: 4
|
176
|
+
summary: "Fastlane plugin for App Center CodePush actions \U0001F680"
|
177
|
+
test_files: []
|