Skip to content

Commit a0049bb

Browse files
Doc & Travis
1 parent b45bccb commit a0049bb

File tree

5 files changed

+67
-78
lines changed

5 files changed

+67
-78
lines changed

.travis.yml

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,52 @@
1-
language: android
2-
3-
jdk: oraclejdk8
1+
matrix:
2+
include:
3+
- stage: "Lint"
4+
language: node_js
5+
os: linux
6+
node_js: "8"
7+
script: cd src && npm run ci.tslint
8+
- stage: "WebPack, Build"
9+
os: osx
10+
env:
11+
- WebPack="iOS"
12+
osx_image: xcode10.0
13+
language: node_js
14+
node_js: "8"
15+
jdk: oraclejdk8
16+
script: cd demo && npm run build.plugin && npm i && tns build ios --bundle --env.uglify
17+
- language: android
18+
env:
19+
- BuildAndroid="28"
20+
os: linux
21+
jdk: oraclejdk8
22+
before_install: nvm install stable
23+
script:
24+
- cd src && npm i && npm run preparedemo && cd ../demo && tns build android
25+
- os: osx
26+
env:
27+
- BuildiOS="12"
28+
- Xcode="10.0"
29+
osx_image: xcode10.0
30+
language: node_js
31+
node_js: "8"
32+
jdk: oraclejdk8
33+
script:
34+
- cd src && npm i && npm run preparedemo && cd ../demo && tns build ios
435

536
android:
637
components:
738
- tools
839
- platform-tools
9-
- build-tools-25.0.2
10-
- android-25
40+
- build-tools-28.0.3
41+
- android-28
1142
- extra-android-m2repository
1243
- sys-img-armeabi-v7a-android-21
1344

14-
before_cache:
15-
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
16-
17-
cache:
18-
directories:
19-
- .nvm
20-
- $HOME/.gradle/caches/
21-
- $HOME/.gradle/wrapper/
45+
before_install:
46+
- sudo pip install --upgrade pip
47+
- sudo pip install six
2248

2349
install:
24-
- nvm install node
25-
- npm install -g nativescript
26-
- tns usage-reporting disable
27-
- tns error-reporting disable
28-
- npm install
29-
30-
before_script:
31-
- echo no | android create avd --force -n test -t android-21 -b armeabi-v7a
32-
- emulator -avd test -no-audio -no-window &
33-
- android-wait-for-emulator
34-
35-
script:
36-
- cd src
37-
- npm run setup
38-
- npm test
50+
- echo no | npm install -g nativescript
51+
- tns usage-reporting disable
52+
- tns error-reporting disable

README.md

Lines changed: 19 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -139,78 +139,50 @@ application.on(application.resumeEvent, () => {
139139
Once your app has been configured and distributed to your users, and you've made some code and/or asset changes,
140140
it's time to instantly release them!
141141

142-
The easiest way to do this is to use the `release-nativescript` command in our CodePush CLI.
142+
The easiest way to do this is to use the `release-nativescript` command in our CodePush CLI. Its (most relevant) options are:
143+
144+
|param|alias|default|description
145+
|---|---|---|---
146+
|deploymentName|d|Staging|Deploy to either "Staging" or "Production".
147+
|description|des||Description of the changes made to the app with this release.
148+
|targetBinaryVersion|t||Semver expression that specifies the binary app version(s) this release is targeting (e.g. 1.1.0, ~1.2.3).
149+
|rollout|r|100%|Percentage of users this release should be available to. The `%` sign is optional.
143150

144151
### iOS
145152

146153
```shell
147154
nativescript-code-push release-nativescript <codepush-ios-appname> ios # deploy to Staging
148155
nativescript-code-push release-nativescript <codepush-ios-appname> ios --d Production # deploy to Production (default: Staging)
149156
nativescript-code-push release-nativescript <codepush-ios-appname> ios --targetBinaryVersion ~1.0.0 # release to users running any 1.x version (default: the exact version in Info.plist)
150-
nativescript-code-push release-nativescript <codepush-ios-appname> ios --rollout 25 # percentage of users this release should be immediately available to (default: 100)
157+
nativescript-code-push release-nativescript <codepush-ios-appname> ios --rollout 25 --description "My awesome iOS version" # percentage of users this release should be immediately available to (default: 100)
151158
```
152159

153160
### Android
154161

155162
```shell
156-
nativescript-code-push release-nativescript <codepush-ios-appname> android # deploy to Staging
157-
nativescript-code-push release-nativescript <codepush-ios-appname> android --d Production # deploy to Production (default: Staging)
158-
nativescript-code-push release-nativescript <codepush-ios-appname> android --targetBinaryVersion ~1.0.0 # release to users running any 1.x version (default: the exact version in AndroidManifest.xml)
163+
nativescript-code-push release-nativescript <codepush-android-appname> android # deploy to Staging
164+
nativescript-code-push release-nativescript <codepush-android-appname> android --d Production # deploy to Production (default: Staging)
165+
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)
159166
```
160167

161168
### Tips
162169
> Make sure to create a release build first, so use the same command that you'd use for app store distribution, just don't send it to the AppStore. You can even webpack bundle and uglify your app, it's all transparent to this plugin.
163170
164171
> When releasing updates to CodePush, you do not need to bump your app's version since you aren't modifying the app store version at all. CodePush will automatically generate a "label" for each release you make (e.g. `v3`) in order to help identify it within your release history.
165172
166-
There are a few options you may want to pass in:
167-
168-
TODO version nr as an additional argument?
173+
### Did folks install the update?
174+
Using a command like this will tell you how many apps have the update installed:
169175

170176
```shell
171-
# Release an update that targets users running any 1.*.* binary, as opposed to everyone ("*") or a specific version (1.0.0)
172-
code-push release CodePushDemo-iOS app "~1.0.0"
173-
174-
# Release an update with a changelog
175-
code-push release CodePushDemo-iOS app "~1.0.0" --description "Fun times!"
176-
177-
# Release a dev Android build to just 1/4 of your end users
178-
code-push release CodePushDemo-iOS app "~1.0.0" --description "Fun times!" --rollout 25%
177+
nativescript-code-push deployment history <codepush-ios-appname> Staging
179178
```
180179

181-
The CodePush client supports incremental updates, so even though you are releasing your entire app code on every update,
182-
your end users will only actually download the files they need. The service handles this automatically so that you can focus on
183-
creating awesome apps and we can worry about optimizing end user downloads.
184-
185180
## Testing CodePush packages during development
186-
187-
How to test your codepush version works:
188-
iOS:
189-
- sim: `tns run ios`
190-
- device: use the `--release` flag: `tns run ios --release`
191-
Android:
192-
- sim: `tns run android`
193-
- device: untested (TODO)
194-
195-
196181
You may want to play with CodePush before using it in production (smart move!).
197-
Perform these steps once you've pushed an update and added the `sync` command:
198-
199-
- `tns run [ios|android] --no-watch --clean`
200-
- kill the app after the update is installed
201-
- restart the app
182+
Perform these steps once you've pushed an update and added the `sync` command to your app:
202183

203-
> Note that (at least on Android) that `--no-watch` is really required as otherwise LiveSync will mess with your test!
184+
- `$ tns run [ios|android] # on an iOS device add the --release flag so LiveSync doesn't mess up your test`
185+
- kill and restart the app after the update is installed
204186

205187
## Future enhancements
206-
207-
### Fix reporting
208-
Using a command like this would normally tell you how many apps have the update installed,
209-
but that's currently work in progress, so don't freak out if it says 'No installs recorded':
210-
211-
```bash
212-
code-push deployment history <app-name> Staging
213-
```
214-
215-
### Support on-resume reloads
216-
I haven't investigated this possibility yet. If it can be pulled off we'll add an option to the `sync` command.
188+
Support on-resume reloads. I haven't investigated this possibility yet. If it can be pulled off we'll add an option to the `sync` command.

demo/demoapp/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import 'nativescript-theme-core/css/core.light.css';
1+
@import '~nativescript-theme-core/css/core.light.css';

demo/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"codepush-clidev.android": "../../code-push/cli/bin/script/./cli.js release-nativescript CodePushDemo-Android android",
2626
"codepush-clidev.android.release": "../../code-push/cli/bin/script/./cli.js 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",
2727
"codepush-clidev.android.rollback": "../../code-push/cli/bin/script/./cli.js rollback CodePushDemo-Android Staging",
28-
"codepush-clidev.android.clear": "../../code-push/cli/bin/script/./cli.js deployment clear CodePushDemo-Android Staging"
28+
"codepush-clidev.android.clear": "../../code-push/cli/bin/script/./cli.js deployment clear CodePushDemo-Android Staging",
29+
"build.plugin": "cd ../src && npm run build && npm run package",
30+
"ci.tslint": "npm i && tslint --config '../tslint.json' 'demoapp/**/*.ts' --exclude '**/node_modules/**' --exclude '**/typings/**'"
2931
},
3032
"dependencies": {
3133
"nativescript-code-push": "file:../publish/package/nativescript-code-push-2.0.0.tgz",
@@ -44,7 +46,9 @@
4446
"karma-nativescript-launcher": "^0.4.0",
4547
"lazy": "1.0.11",
4648
"nativescript-dev-typescript": "~0.9.0",
49+
"nativescript-dev-webpack": "^0.21.2",
4750
"tns-platform-declarations": "~5.3.2",
51+
"tslint": "~5.4.3",
4852
"typescript": "~3.2.4"
4953
}
5054
}

src/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"demo.ios.device": "npm run preparedemo && cd ../demo && tns run ios --release",
2929
"demo.android": "npm run preparedemo && cd ../demo && tns run android",
3030
"preparedemo": "npm run build && npm run package && cd ../demo && tns plugin add ../publish/package/*.tgz && rimraf platforms/android",
31-
"disabled-prepublish": "npm run build",
3231
"setup": "npm i && cd ../demo && npm i && cd ../src && npm run build",
3332
"tslint": "tslint *.ts",
3433
"tslint.demo": "tslint ../demo/app/*.ts",

0 commit comments

Comments
 (0)