fastlane-plugin-codepush 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +146 -4
- data/lib/fastlane/plugin/codepush/actions/codepush_add_deployment_action.rb +71 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_exists_deployment_action copy.rb +71 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_get_deployment_key_action.rb +79 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_list_deployment_action.rb +64 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_remove_deployment_action.rb +71 -0
- data/lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb +78 -0
- data/lib/fastlane/plugin/codepush/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fed12971e8dc59e4b6acc0ac861c283c2f85547b13df0b4d321065c394518dc
|
4
|
+
data.tar.gz: 25be99c5ff18dfcd7e7aecc95a16ea4fbd3f17740630d8a3f6d065f7d8525a61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18e9807a748792410da69b6d6e2fd40cbb77026c6d14e1316acc87c5dcb9204cd4f83147b257049d7a5b57b7ba719dc06a113d57c97e554abb88f239433dd23e
|
7
|
+
data.tar.gz: 1f117225a521e6c9386ccc2808c3d3ddc17d93a4a9f66d1af5c0b9e053358df53c2bc91fc76961fd5ac41504f1c7a5c3b21f6427a9f753cb2a158fb5c6fcf2ea
|
data/README.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-codepush)
|
4
4
|
|
5
|
+
[📚Documentation](https://pranit-harekar.github.io/fastlane-plugin-codepush)
|
6
|
+
|
7
|
+
## Prerequisites
|
8
|
+
|
9
|
+
Install the [App Center CLI](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#installation)
|
10
|
+
|
11
|
+
```
|
12
|
+
npm install -g appcenter-cli
|
13
|
+
```
|
14
|
+
|
5
15
|
## Getting Started
|
6
16
|
|
7
17
|
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:
|
@@ -24,7 +34,7 @@ This is a Fastlane plugin for App Center CodePush service.
|
|
24
34
|
codepush_login
|
25
35
|
```
|
26
36
|
|
27
|
-
|
|
37
|
+
| Option | Description | Environment Variable | Default |
|
28
38
|
| ----------- | --------------------------------------------------------------------------------------------------- | ---------------------- | ------- |
|
29
39
|
| login_token | App center login token to access CodePush service, optional if ENV['APP_CENTER_LOGIN_TOKEN'] is set | APP_CENTER_LOGIN_TOKEN | |
|
30
40
|
| enforce | Enforce logout before login | | false |
|
@@ -50,7 +60,7 @@ codepush_release_react(
|
|
50
60
|
)
|
51
61
|
```
|
52
62
|
|
53
|
-
|
|
63
|
+
| Option | Description | Environment Variable | Default |
|
54
64
|
| ------------------------------- | ---------------------------------------------------------------------------------- | -------------------- | ------- |
|
55
65
|
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
56
66
|
| execution_dir_path | Release React CLI command execution dir path | | ./ |
|
@@ -74,7 +84,7 @@ codepush_release_react(
|
|
74
84
|
| bundle_name | File name that should be used for the generated JS bundle | | |
|
75
85
|
| dry_run | Print the command that would be run, and don't run it | | false |
|
76
86
|
|
77
|
-
####
|
87
|
+
#### 4. `codepush_promote`
|
78
88
|
|
79
89
|
CodePush [promote deployment](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#promoting-updates) action
|
80
90
|
|
@@ -88,7 +98,7 @@ codepush_promote(
|
|
88
98
|
)
|
89
99
|
```
|
90
100
|
|
91
|
-
|
|
101
|
+
| Option | Description | Environment Variable | Default |
|
92
102
|
| ------------------------------- | ------------------------------------------------------------------------- | -------------------- | ------- |
|
93
103
|
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
94
104
|
| execution_dir_path | Promote CLI command execution dir path | | ./ |
|
@@ -101,6 +111,133 @@ codepush_promote(
|
|
101
111
|
| disable_telemetry | Specify whether telemetry should be disabled or not | | false |
|
102
112
|
| dry_run | Print the command that would be run, and don't run it | | false |
|
103
113
|
|
114
|
+
#### 5. `codepush_add_deployment`
|
115
|
+
|
116
|
+
CodePush [add deployment](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#deployment-management) action
|
117
|
+
|
118
|
+
This action lets you add new CodePush deployment.
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
codepush_add_deployment(
|
122
|
+
app_name: "pharekar/MyAwesomeApp",
|
123
|
+
deployment_name: "Alpha"
|
124
|
+
)
|
125
|
+
```
|
126
|
+
|
127
|
+
| Option | Description | Environment Variable | Default |
|
128
|
+
| ------------------ | ------------------------------------------------------------------------- | -------------------- | ------- |
|
129
|
+
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
130
|
+
| execution_dir_path | Release React CLI command execution dir path | | ./ |
|
131
|
+
| deployment_name | Deployment name | | |
|
132
|
+
| dry_run | Print the command that would be run, and don't run it | | false |
|
133
|
+
|
134
|
+
#### 6. `codepush_remove_deployment`
|
135
|
+
|
136
|
+
CodePush [remove deployment](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#deployment-management) action
|
137
|
+
|
138
|
+
This action lets you remove CodePush deployment.
|
139
|
+
|
140
|
+
```ruby
|
141
|
+
codepush_remove_deployment(
|
142
|
+
app_name: "pharekar/MyAwesomeApp",
|
143
|
+
deployment_name: "Alpha"
|
144
|
+
)
|
145
|
+
```
|
146
|
+
|
147
|
+
| Option | Description | Environment Variable | Default |
|
148
|
+
| ------------------ | ------------------------------------------------------------------------- | -------------------- | ------- |
|
149
|
+
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
150
|
+
| execution_dir_path | Release React CLI command execution dir path | | ./ |
|
151
|
+
| deployment_name | Deployment name | | |
|
152
|
+
| dry_run | Print the command that would be run, and don't run it | | false |
|
153
|
+
|
154
|
+
#### 7. `codepush_rename_deployment`
|
155
|
+
|
156
|
+
CodePush [rename deployment](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#deployment-management) action
|
157
|
+
|
158
|
+
This action lets you rename CodePush deployment.
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
codepush_rename_deployment(
|
162
|
+
app_name: "pharekar/MyAwesomeApp",
|
163
|
+
deployment_name: "Alpha",
|
164
|
+
new_deployment_name: "Internal-Alpha"
|
165
|
+
)
|
166
|
+
```
|
167
|
+
|
168
|
+
| Option | Description | Environment Variable | Default |
|
169
|
+
| ------------------- | ------------------------------------------------------------------------- | -------------------- | ------- |
|
170
|
+
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
171
|
+
| execution_dir_path | Release React CLI command execution dir path | | ./ |
|
172
|
+
| deployment_name | Deployment name | | |
|
173
|
+
| new_deployment_name | New deployment name | | |
|
174
|
+
| dry_run | Print the command that would be run, and don't run it | | false |
|
175
|
+
|
176
|
+
#### 8. `codepush_list_deployment`
|
177
|
+
|
178
|
+
CodePush [list deployment](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#deployment-management) action
|
179
|
+
|
180
|
+
This action lets you list all CodePush deployment.
|
181
|
+
|
182
|
+
```ruby
|
183
|
+
codepush_list_deployment(
|
184
|
+
app_name: "pharekar/MyAwesomeApp"
|
185
|
+
)
|
186
|
+
```
|
187
|
+
|
188
|
+
| Option | Description | Environment Variable | Default |
|
189
|
+
| ------------------ | ------------------------------------------------------------------------- | -------------------- | ------- |
|
190
|
+
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
191
|
+
| execution_dir_path | Release React CLI command execution dir path | | ./ |
|
192
|
+
| dry_run | Print the command that would be run, and don't run it | | false |
|
193
|
+
|
194
|
+
#### 9. `codepush_exists_deployment`
|
195
|
+
|
196
|
+
This action lets check if given CodePush deployment exists. Returns boolean value.
|
197
|
+
|
198
|
+
```ruby
|
199
|
+
codepush_exists_deployment(
|
200
|
+
app_name: "pharekar/MyAwesomeApp",
|
201
|
+
deployment_name: "Alpha"
|
202
|
+
)
|
203
|
+
|
204
|
+
## returns true if 'Alpha' deployment exists otherwise false
|
205
|
+
```
|
206
|
+
|
207
|
+
| Option | Description | Environment Variable | Default |
|
208
|
+
| ------------------ | ------------------------------------------------------------------------- | -------------------- | ------- |
|
209
|
+
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
210
|
+
| execution_dir_path | Release React CLI command execution dir path | | ./ |
|
211
|
+
| deployment_name | Deployment name | | |
|
212
|
+
| dry_run | Print the command that would be run, and don't run it | | false |
|
213
|
+
|
214
|
+
#### 10. `codepush_get_deployment_key`
|
215
|
+
|
216
|
+
This action returns CodePush deployment key given deployment name. If deployment does not exists it returns `nil`
|
217
|
+
|
218
|
+
```ruby
|
219
|
+
codepush_get_deployment_key(
|
220
|
+
app_name: "pharekar/MyAwesomeApp",
|
221
|
+
deployment_name: "Alpha"
|
222
|
+
)
|
223
|
+
|
224
|
+
## 1243453jksau2113l2h1k323h1829ebj
|
225
|
+
|
226
|
+
codepush_get_deployment_key(
|
227
|
+
app_name: "pharekar/MyAwesomeApp",
|
228
|
+
deployment_name: "foo"
|
229
|
+
)
|
230
|
+
|
231
|
+
## nil
|
232
|
+
```
|
233
|
+
|
234
|
+
| Option | Description | Environment Variable | Default |
|
235
|
+
| ------------------ | ------------------------------------------------------------------------- | -------------------- | ------- |
|
236
|
+
| app_name | Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set | APP_CENTER_APP_NAME | |
|
237
|
+
| execution_dir_path | Release React CLI command execution dir path | | ./ |
|
238
|
+
| deployment_name | Deployment name | | |
|
239
|
+
| dry_run | Print the command that would be run, and don't run it | | false |
|
240
|
+
|
104
241
|
## Example
|
105
242
|
|
106
243
|
Check out the [example `Fastfile`](examples/ReactNative/fastlane/Fastfile) to see how to use this plugin.
|
@@ -134,3 +271,8 @@ For more information about how the `fastlane` plugin system works, check out the
|
|
134
271
|
## About _fastlane_
|
135
272
|
|
136
273
|
_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).
|
274
|
+
|
275
|
+
## Why this plugin?
|
276
|
+
|
277
|
+
- [fastlane-plugin-appcenter](https://github.com/microsoft/fastlane-plugin-appcenter) does not support CodePush
|
278
|
+
- [Fastfastlane-plugin-code_pushlane](https://github.com/manuelkch/fastlane-plugin-code_push) is outdated & does not support App Center CLI
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class CodepushAddDeploymentAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
Dir.chdir(params[:execution_dir_path].to_s) do
|
8
|
+
command = "appcenter codepush deployment add "
|
9
|
+
## params
|
10
|
+
command += "-a #{params[:app_name]} "
|
11
|
+
command += (params[:deployment_name]).to_s
|
12
|
+
|
13
|
+
if params[:dry_run]
|
14
|
+
UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
|
15
|
+
else
|
16
|
+
sh(command.to_s)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.description
|
22
|
+
'CodePush add deployment action'
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.authors
|
26
|
+
['Pranit Harekar']
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.return_value
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.details
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.available_options
|
36
|
+
[
|
37
|
+
FastlaneCore::ConfigItem.new(
|
38
|
+
key: :app_name,
|
39
|
+
env_name: "APP_CENTER_APP_NAME",
|
40
|
+
description: "Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set",
|
41
|
+
optional: false,
|
42
|
+
type: String
|
43
|
+
),
|
44
|
+
FastlaneCore::ConfigItem.new(
|
45
|
+
key: :execution_dir_path,
|
46
|
+
description: 'Release React CLI command execution dir path',
|
47
|
+
optional: true,
|
48
|
+
type: String,
|
49
|
+
default_value: "./"
|
50
|
+
),
|
51
|
+
FastlaneCore::ConfigItem.new(
|
52
|
+
key: :deployment_name,
|
53
|
+
description: 'Deployment name',
|
54
|
+
optional: false,
|
55
|
+
type: String
|
56
|
+
),
|
57
|
+
FastlaneCore::ConfigItem.new(
|
58
|
+
key: :dry_run,
|
59
|
+
description: "Print the command that would be run, and don't run it",
|
60
|
+
is_string: false,
|
61
|
+
default_value: false
|
62
|
+
)
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.is_supported?(platform)
|
67
|
+
true
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class CodepushExistsDeploymentAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
Dir.chdir(params[:execution_dir_path].to_s) do
|
8
|
+
command = "appcenter codepush deployment list "
|
9
|
+
## params
|
10
|
+
command += "-a #{params[:app_name]}"
|
11
|
+
|
12
|
+
if params[:dry_run]
|
13
|
+
UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
|
14
|
+
else
|
15
|
+
return sh(command.to_s).include?(params[:deployment_name])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.description
|
21
|
+
'CodePush check if deployment exists'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.authors
|
25
|
+
['Pranit Harekar']
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.return_value
|
29
|
+
'Returns boolean value indicating whether deployment exists or not'
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.details
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.available_options
|
36
|
+
[
|
37
|
+
FastlaneCore::ConfigItem.new(
|
38
|
+
key: :app_name,
|
39
|
+
env_name: "APP_CENTER_APP_NAME",
|
40
|
+
description: "Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set",
|
41
|
+
optional: false,
|
42
|
+
type: String
|
43
|
+
),
|
44
|
+
FastlaneCore::ConfigItem.new(
|
45
|
+
key: :execution_dir_path,
|
46
|
+
description: 'Release React CLI command execution dir path',
|
47
|
+
optional: true,
|
48
|
+
type: String,
|
49
|
+
default_value: "./"
|
50
|
+
),
|
51
|
+
FastlaneCore::ConfigItem.new(
|
52
|
+
key: :dry_run,
|
53
|
+
description: "Print the command that would be run, and don't run it",
|
54
|
+
is_string: false,
|
55
|
+
default_value: false
|
56
|
+
),
|
57
|
+
FastlaneCore::ConfigItem.new(
|
58
|
+
key: :deployment_name,
|
59
|
+
description: 'Deployment name',
|
60
|
+
optional: false,
|
61
|
+
type: String
|
62
|
+
)
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.is_supported?(platform)
|
67
|
+
true
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class CodepushGetDeploymentKeyAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
Dir.chdir(params[:execution_dir_path].to_s) do
|
8
|
+
result = Actions::CodepushExistsDeploymentAction.run(params)
|
9
|
+
if result
|
10
|
+
command = "appcenter codepush deployment list "
|
11
|
+
## params
|
12
|
+
command += "-a #{params[:app_name]} "
|
13
|
+
command += "--displayKeys "
|
14
|
+
command += "| grep '#{params[:deployment_name]}'"
|
15
|
+
|
16
|
+
if params[:dry_run]
|
17
|
+
UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
|
18
|
+
else
|
19
|
+
sh(command.to_s)[-50...-13]
|
20
|
+
end
|
21
|
+
else
|
22
|
+
UI.important("🙅♀️ Deployment '#{params[:deployment_name]}' does not exists!")
|
23
|
+
return nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.description
|
29
|
+
'CodePush get deployment key given deployment name'
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.authors
|
33
|
+
['Pranit Harekar']
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.return_value
|
37
|
+
'Returns deployment key in string format. Returns nil if deployment does not exists'
|
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: 'Release React CLI command execution dir path',
|
55
|
+
optional: true,
|
56
|
+
type: String,
|
57
|
+
default_value: "./"
|
58
|
+
),
|
59
|
+
FastlaneCore::ConfigItem.new(
|
60
|
+
key: :dry_run,
|
61
|
+
description: "Print the command that would be run, and don't run it",
|
62
|
+
is_string: false,
|
63
|
+
default_value: false
|
64
|
+
),
|
65
|
+
FastlaneCore::ConfigItem.new(
|
66
|
+
key: :deployment_name,
|
67
|
+
description: 'Deployment name',
|
68
|
+
optional: false,
|
69
|
+
type: String
|
70
|
+
)
|
71
|
+
]
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.is_supported?(platform)
|
75
|
+
true
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class CodepushListDeploymentAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
Dir.chdir(params[:execution_dir_path].to_s) do
|
8
|
+
command = "appcenter codepush deployment list "
|
9
|
+
## params
|
10
|
+
command += "-a #{params[:app_name]}"
|
11
|
+
|
12
|
+
if params[:dry_run]
|
13
|
+
UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
|
14
|
+
else
|
15
|
+
sh(command.to_s)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.description
|
21
|
+
'CodePush list deployment action'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.authors
|
25
|
+
['Pranit Harekar']
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.return_value
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.details
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.available_options
|
35
|
+
[
|
36
|
+
FastlaneCore::ConfigItem.new(
|
37
|
+
key: :app_name,
|
38
|
+
env_name: "APP_CENTER_APP_NAME",
|
39
|
+
description: "Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set",
|
40
|
+
optional: false,
|
41
|
+
type: String
|
42
|
+
),
|
43
|
+
FastlaneCore::ConfigItem.new(
|
44
|
+
key: :execution_dir_path,
|
45
|
+
description: 'Release React CLI command execution dir path',
|
46
|
+
optional: true,
|
47
|
+
type: String,
|
48
|
+
default_value: "./"
|
49
|
+
),
|
50
|
+
FastlaneCore::ConfigItem.new(
|
51
|
+
key: :dry_run,
|
52
|
+
description: "Print the command that would be run, and don't run it",
|
53
|
+
is_string: false,
|
54
|
+
default_value: false
|
55
|
+
)
|
56
|
+
]
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.is_supported?(platform)
|
60
|
+
true
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class CodepushRemoveDeploymentAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
Dir.chdir(params[:execution_dir_path].to_s) do
|
8
|
+
command = "appcenter codepush deployment remove "
|
9
|
+
## params
|
10
|
+
command += "-a #{params[:app_name]} "
|
11
|
+
command += (params[:deployment_name]).to_s
|
12
|
+
|
13
|
+
if params[:dry_run]
|
14
|
+
UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
|
15
|
+
else
|
16
|
+
sh(command.to_s)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.description
|
22
|
+
'CodePush remove deployment action'
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.authors
|
26
|
+
['Pranit Harekar']
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.return_value
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.details
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.available_options
|
36
|
+
[
|
37
|
+
FastlaneCore::ConfigItem.new(
|
38
|
+
key: :app_name,
|
39
|
+
env_name: "APP_CENTER_APP_NAME",
|
40
|
+
description: "Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set",
|
41
|
+
optional: false,
|
42
|
+
type: String
|
43
|
+
),
|
44
|
+
FastlaneCore::ConfigItem.new(
|
45
|
+
key: :execution_dir_path,
|
46
|
+
description: 'Release React CLI command execution dir path',
|
47
|
+
optional: true,
|
48
|
+
type: String,
|
49
|
+
default_value: "./"
|
50
|
+
),
|
51
|
+
FastlaneCore::ConfigItem.new(
|
52
|
+
key: :deployment_name,
|
53
|
+
description: 'Deployment name',
|
54
|
+
optional: false,
|
55
|
+
type: String
|
56
|
+
),
|
57
|
+
FastlaneCore::ConfigItem.new(
|
58
|
+
key: :dry_run,
|
59
|
+
description: "Print the command that would be run, and don't run it",
|
60
|
+
is_string: false,
|
61
|
+
default_value: false
|
62
|
+
)
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.is_supported?(platform)
|
67
|
+
true
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class CodepushRenameDeploymentAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
Dir.chdir(params[:execution_dir_path].to_s) do
|
8
|
+
command = "appcenter codepush deployment rename "
|
9
|
+
## params
|
10
|
+
command += "-a #{params[:app_name]} "
|
11
|
+
command += "#{params[:deployment_name]} "
|
12
|
+
command += (params[:new_deployment_name]).to_s
|
13
|
+
|
14
|
+
if params[:dry_run]
|
15
|
+
UI.message('Dry run!'.red + ' Would have run: ' + command + "\n")
|
16
|
+
else
|
17
|
+
sh(command.to_s)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.description
|
23
|
+
'CodePush rename deployment 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
|
+
end
|
35
|
+
|
36
|
+
def self.available_options
|
37
|
+
[
|
38
|
+
FastlaneCore::ConfigItem.new(
|
39
|
+
key: :app_name,
|
40
|
+
env_name: "APP_CENTER_APP_NAME",
|
41
|
+
description: "Name of the App Center app, optional if ENV['APP_CENTER_APP_NAME'] is set",
|
42
|
+
optional: false,
|
43
|
+
type: String
|
44
|
+
),
|
45
|
+
FastlaneCore::ConfigItem.new(
|
46
|
+
key: :execution_dir_path,
|
47
|
+
description: 'Release React CLI command execution dir path',
|
48
|
+
optional: true,
|
49
|
+
type: String,
|
50
|
+
default_value: "./"
|
51
|
+
),
|
52
|
+
FastlaneCore::ConfigItem.new(
|
53
|
+
key: :deployment_name,
|
54
|
+
description: 'Deployment name',
|
55
|
+
optional: false,
|
56
|
+
type: String
|
57
|
+
),
|
58
|
+
FastlaneCore::ConfigItem.new(
|
59
|
+
key: :new_deployment_name,
|
60
|
+
description: 'New deployment name',
|
61
|
+
optional: false,
|
62
|
+
type: String
|
63
|
+
),
|
64
|
+
FastlaneCore::ConfigItem.new(
|
65
|
+
key: :dry_run,
|
66
|
+
description: "Print the command that would be run, and don't run it",
|
67
|
+
is_string: false,
|
68
|
+
default_value: false
|
69
|
+
)
|
70
|
+
]
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.is_supported?(platform)
|
74
|
+
true
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-codepush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pranit Harekar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -145,10 +145,16 @@ files:
|
|
145
145
|
- LICENSE
|
146
146
|
- README.md
|
147
147
|
- lib/fastlane/plugin/codepush.rb
|
148
|
+
- lib/fastlane/plugin/codepush/actions/codepush_add_deployment_action.rb
|
149
|
+
- lib/fastlane/plugin/codepush/actions/codepush_exists_deployment_action copy.rb
|
150
|
+
- lib/fastlane/plugin/codepush/actions/codepush_get_deployment_key_action.rb
|
151
|
+
- lib/fastlane/plugin/codepush/actions/codepush_list_deployment_action.rb
|
148
152
|
- lib/fastlane/plugin/codepush/actions/codepush_login_action.rb
|
149
153
|
- lib/fastlane/plugin/codepush/actions/codepush_logout_action.rb
|
150
154
|
- lib/fastlane/plugin/codepush/actions/codepush_promote_action.rb
|
151
155
|
- lib/fastlane/plugin/codepush/actions/codepush_release_react_action.rb
|
156
|
+
- lib/fastlane/plugin/codepush/actions/codepush_remove_deployment_action.rb
|
157
|
+
- lib/fastlane/plugin/codepush/actions/codepush_rename_deployment_action.rb
|
152
158
|
- lib/fastlane/plugin/codepush/helper/codepush_login_helper.rb
|
153
159
|
- lib/fastlane/plugin/codepush/version.rb
|
154
160
|
homepage: https://github.com/Pranit-Harekar/fastlane-plugin-codepush
|