Skip to content

Commit fd02159

Browse files
Documented rollback & clear
1 parent 9f47dfb commit fd02159

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ The CodePush plugin helps get product improvements in front of your end users in
2929

3030
In order to ensure that your end users always have a functioning version of your app, the CodePush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to roll back on the server. It's a win-win-win!
3131

32-
> ⚠️ TODO test the rollback flow!
33-
3432
_To confuse you even more, have a diagram of the bits involved in this solution:_
3533

3634
<img src="https://github.com/EddyVerbruggen/nativescript-code-push/raw/master/media/NativeScript%20CodePush%20landscape.png" width="570px" height="508px">
@@ -51,7 +49,7 @@ can push happily. And if you do bump a version of a dependency make sure there a
5149
## Getting Started
5250
> ⚠️ TODO test this workflow!
5351
54-
#### Globally install the NativeScript-compatible CodePush CLI
52+
#### Globally install the NativeScript CodePush CLI
5553

5654
```shell
5755
npm i -g nativescript-code-push-cli
@@ -158,7 +156,7 @@ application.on(application.resumeEvent, () => {
158156
});
159157
```
160158

161-
## Releasing updates
159+
## Releasing an update
162160
Once your app has been configured and distributed to your users, and you've made some code and/or asset changes,
163161
it's time to instantly unleash those changes onto your users!
164162

@@ -194,8 +192,19 @@ nativescript-code-push release-nativescript <codepush-android-appname> android -
194192
nativescript-code-push release-nativescript <codepush-android-appname> android --targetBinaryVersion ~1.0.0 # release to users running any 1.x version (default: the exact version in AndroidManifest.xml)
195193
```
196194

197-
## CodePush CLI tricks
198-
Here are a few commands you may find useful:
195+
## Rolling back an update
196+
Roll back the latest release (of the `Staging` app, in this case):
197+
198+
```shell
199+
nativescript-code-push rollback CodePushDemoIOS Staging
200+
nativescript-code-push rollback <codepush-appname> Staging
201+
```
202+
203+
Functionally, this will work just like any other CodePush update, but it installs the previous version
204+
and will no longer push the rolled back version to new devices.
205+
206+
## Gaining insight in past releases
207+
Here are a few CodePush CLI commands you may find useful:
199208

200209
### Which releases did I create and what are the install metrics?
201210
Using a command like this will tell you how many apps have the update installed:
@@ -238,6 +247,13 @@ Which produces something like this:
238247
| | |Released By: eddyverbruggen@gmail.com|
239248
| | |Description: Mandatory iOS version!|
240249

250+
### Clearing the release history
251+
This won't roll back any releases, but it cleans up the history metadata (of the `Staging` app, in this case):
252+
253+
```shell
254+
nativescript-code-push deployment clear <codepush-appname> Staging
255+
```
256+
241257
## Testing CodePush packages during development
242258
You may want to play with CodePush before using it in production (smart move!).
243259
Perform these steps once you've pushed an update and added the `sync` command to your app:

demo/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"codepush.android": "nativescript-code-push release-nativescript CodePushDemo-Android android --description 'Awesome Android version!' --targetBinaryVersion 2.0.0",
2121
"codepush.android.v2": "nativescript-code-push release-nativescript CodePushDemo-Android android --description 'Awesome Android version!' --targetBinaryVersion 2.0.0",
2222
"codepush.android.release": "nativescript-code-push release-nativescript CodePushDemo-Android android -deploymentName Staging --build --isReleaseBuildType --keystorePath \"/Users/eddyverbruggen/Desktop/werkmap/Android dev X-Services/xservices.keystore\" --keystorePassword YOUR_PASSWORD --keystoreAlias xservices --keystoreAliasPassword YOUR_PASSWORD",
23+
"codepush.ios.rollback": "nativescript-code-push rollback CodePushDemoIOS Staging",
24+
"codepush.ios.clear": "nativescript-code-push deployment clear CodePushDemoIOS Staging",
25+
"codepush.android.rollback": "nativescript-code-push rollback CodePushDemo-Android Staging",
26+
"codepush.android.clear": "nativescript-code-push deployment clear CodePushDemo-Android Staging",
2327
"build.plugin": "cd ../src && npm i && npm run build && npm run package",
2428
"ci.tslint": "npm i && tslint --config '../tslint.json' 'demoapp/**/*.ts' --exclude '**/node_modules/**' --exclude '**/typings/**'"
2529
},

0 commit comments

Comments
 (0)