Giter VIP home page Giter VIP logo

cordova-hot-code-push-cli's Introduction

THIS PROJECT IS DEPRECATED

We are not using this repo anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork. See #79 for more information.

Cordova Hot Code Push Plugin CLI client

This is a command line utility for Cordova Hot Code Push Plugin. It will help you with development and deploy changes to your Cordova application via hot code push, without the need to submit your changes to the Apple App Store or Google Play.

Main features are:

  • Automatically generate configuration files, required for Hot Code Push plugin (chcp.json and chcp.manifest).
  • Run local server in order to detect any changes you make in your web project and instantly upload them on the devices.
  • Deploy your web project on the external servers with the single command. For now it only supports deployment on the Amazon servers. More deployment targets will be added later.

Documentation

Installation

You can install CLI client using npm install (current stable 1.1.1):

npm install -g cordova-hot-code-push-cli

It is also possible to install via repo url directly (unstable):

npm install -g https://github.com/nordnet/cordova-hot-code-push-cli.git

How to use

cordova-hcp <command>

Where <command> can be:

  • init - initialize project parameters, create default cordova-hcp.json file.
  • build - build project files, generate chcp.json and chcp.manifest files in the www folder. Prepare for deployment.
  • server - run local server that is used for local development process.
  • login - create login credentials that are used for deployment of project files on the remote server.
  • deploy - upload project files on the remote server.

All commands should be executed in the root folder of your Cordova project. For example, lets assume you have a Cordova TestProject with the following structure:

TestProject/
  config.xml
  hooks/
  node_modules/
  platforms/
  plugins/
  www/

Then cordova-hcp commands should be executed in the TestProject folder.

Commands

Init command

cordova-hcp init

Initialization command for CLI client. Generates default application configuration file (cordova-hcp.json) in the projects root folder. This file is used later on for build and deploy.

When executed - you will be asked to fill in some project preferences from the command line:

  • Project name - your current project name. Required.
  • Amazon S3 Bucket name - name of the S3 Bucket on the Amazon. Required for deployment, can be skipped in other cases.
  • Amazon S3 region - Amazon S3 region. Required for deployment, can be skipped in other cases.
  • iOS app identifier - applications id on the App Store. Used to redirect user to the applications page on the store.
  • Android app identifier - applications package name by which we reference app on the Google Play.
  • Update method - when to perform the update. Supports three keys:
    • start - install updates when application is launched;
    • resume - install update when application is resumed (moved from background to foreground state) or launched; used by default;
    • now - install update as soon as it is loaded from the server.

For example, execute init in your project root folder and fill preferences as below:

Running init
Please provide: Enter project name (required):  TestProject
Please provide: Amazon S3 Bucket name (required for cordova-hcp deploy):  chcp-test
Please provide: Amazon S3 region (required for cordova-hcp deploy):  (us-east-1) eu-west-1
Please provide: IOS app identifier:  id123456789
Please provide: Android app identifier:  com.example.chcp.testproject
Please provide: Update method (required):  (resume) start
Project initialized and cordova-hcp.json file created.
If you wish to exclude files from being published, specify them in .chcpignore
Before you can push updates you need to run "cordova-hcp login" in project directory

As a result, content of the cordova-hcp.json file will be:

{
  "name": "TestProject",
  "s3bucket": "chcp-test",
  "s3region": "eu-west-1",
  "ios_identifier": "id123456789",
  "android_identifier": "com.example.chcp.testproject",
  "update": "start",
  "content_url": "https://s3-eu-west-1.amazonaws.com/chcp-test"
}

You can skip initialization for local development process when you execute

cordova-hcp server

More details about server command can be found below.

Build command

cordova-hcp build [www_directory]

where:

  • [www_directory] - path to the directory with your web project. If not specified - www is used.

Command is used to prepare project for deployment and to generate plugin specific configuration files inside www folder:

  • chcp.json - holds release related information.
  • chcp.manifest - holds information about web project files: their names (relative paths) and hashes.

When executed - you will see in the terminal window:

Running build
Build 2015.09.07-11.20.55 created in /Cordova/TestProject/www

As a result, chcp.json and chcp.manifest files are generated in the www folder and project is ready for deployment.

More information about those configs can be found on Cordova Hot Code Push plugin documentation page.

Server command

cordova-hcp server [www_directory]

where:

  • [www_directory] - path to the directory with your web project. If not specified - www is used.

Command is used for local development purpose only. It starts local server that listens for changes inside your web folder (with respect to .chcpignore) and sends notification about the new release to the connected users. This way you can develop your application and see results in the real-time.

You can use server without running init at first. In that case, application configuration file (www/chcp.json) is generated with the default values and autogenerated flag:

{
  "autogenerated": true,
  "release": "2015.09.07-12.28.38",
  "content_url": "https://19d5cfa2.ngrok.com",
  "update": "now"
}

How it works:

  1. Launch server in the project root by executing:
cordova-hcp server

As a result, you will see something like this:

Running server
Checking:  /Cordova/TestProject/www
local_url http://localhost:31284
Build 2015.09.07-10.12.25 created in /Cordova/TestProject/www
cordova-hcp local server available at: http://localhost:31284
cordova-hcp public server available at: https://19d5cfa2.ngrok.com
  1. Launch application on your emulators or test devices:
cordova run
  1. When application starts - it connects to the local server via socket. In the servers console window you should see following message:
a user connected
  1. Open any file from your www folder and do some changes in it. For example, change index.html. As a result, you will see in the servers console:
File changed:  /TestProject/www/index.html
Build 2015.09.07-10.12.31 created in /TestProject/www
Should trigger reload for build: 2015.09.07-10.12.31

This means that cordova-hcp detected your changes, executed build command and sent notification via socket to the connected users.

  1. On the mobile side plugin captures new release event through the socket and loads it from the server.

Note: if during the development you will add some new plugin to the project - then you have to:

  1. Delete old version of the app.
  2. Reinstall the app with cordova run command.

Login command

cordova-hcp login

Command requests and saves login credentials, using which deployment on the Amazon servers is performed. You need to run it before doing any deployment. Otherwise, cordova-hcp won't now how to login to the Amazon.

When executed, you will be asked to enter your Amazon Access Key Id and Access Key Secret:

Running login
Please provide: Amazon Access Key Id:  YOUR_ACCESS_KEY_ID
Please provide: Amazon Secret Access Key:  YOUR_ACCESS_KEY_SECRET

Entered credentials will be placed in the .chcplogin file:

{
  "key": "YOUR_ACCESS_KEY_ID",
  "secret": "YOUR_ACCESS_KEY_SECRET"
}

From this point you are ready to deploy your project on Amazon server.

Advise: don't forget to put .chcplogin file in the ignore list of your version control system, if any is used. For git you can do this by executing:

echo '.chcplogin' >> .gitignore

Deploy command

cordova-hcp deploy [www_directory]

where:

  • [www_directory] - path to the directory with your web project. If not specified - www is used.

Command uploads your Cordova's web project files on the Amazon server. Can be executed only after init and login commands.

When executed, you will see the following in the console:

Running deploy
Config { name: 'TestProject',
  s3bucket: 'chcp-test',
  s3region: 'eu-west-1',
  ios_identifier: 'id123456789',
  android_identifier: 'com.example.chcp.testproject',
  update: 'start',
  content_url: 'https://s3-eu-west-1.amazonaws.com/chcp-test',
  release: '2015.09.07-13.02.28' }
Build 2015.09.07-13.02.28 created in /Cordova/TestProject/www
Deploy started
Deploy done

As a result - all files from your web directory are uploaded to the Amazon server, which was defined on the init step.

Default configuration file

As mentioned in Init command section of the readme - after executing cordova-hcp init command you will get a default configuration file, called cordova-hcp.json. It is created in the root folder of your project. When you run cordova-hcp build - data from that file is used to generate chcp.json file in www folder.

If you want - you can create cordova-hcp.json manually and put in there any options you want. It's just a JSON object like so:

{
  "update": "start",
  "content_url": "https://mycoolserver.com/mobile_content/"
}

By default, you would probably put in there your content_url. But it can also be any other setting.

Ignored files list

By default, CLI client ignores all hidden files, and files from the following list:

chcp.json
chcp.manifest
package.json
node_modules/*

But if you want - you can extend this list like so:

  1. Create .chcpignore file in the root of your Cordova Project (for example, /Cordova/TestProject/.chcpignore).
  2. Add ignored files. For example:
dirty.html
images/*
libs/*

As a result, those files will be excluded from the chcp.manifest, and ignored by the server in local development mode.

If you want - you can add comments by using # like this:

# Ignore libraries
libs/*

# Ignore images
images/*

Normal workflow scheme

  1. Initialize:
cordova-hcp init
  1. Provide login preferences:
cordova-hcp login
  1. Build your project:
cordova-hcp build
  1. Upload project on the server:
cordova-hcp deploy
  1. When new version is ready - repeat steps 3. and 4..

Local development workflow scheme

  1. Run server:
cordova-hcp server
  1. Run application:
cordova run
  1. Do some changes in the www folder. Wait for a few moments and see the result on the launched devices (emulators).

cordova-hot-code-push-cli's People

Contributors

alexbuijs avatar andreasronge avatar andreialecu avatar dimchez avatar hassellof avatar livelazily avatar nikdemyankov avatar nordnet-deprecation-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-hot-code-push-cli's Issues

Simplify init logic

Need to simplify the cordova-hcp init command. People sometimes struggling with the way on how to provide content_url on the build process.

install error

C:\Users\ryanl>npm install -g cordova-hot-code-push-cli
npm WARN peerDependencies The peer dependency level@~1.3.0 included from s3-sync-aws will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated [email protected]: renamed to d3-queue
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
|

[email protected] postinstall C:\Users\ryanl\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\ngrok
node ./postinstall.js

ngrok - downloading binary https://bin.equinox.io/a/54cQjE1obr2/ngrok-2.1.1-windows-386.zip ...
ngrok - binary downloaded...
ngrok - binary unpacked.

[email protected] install C:\Users\ryanl\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\level\node_modules\leveldown
prebuild --install

prebuild WARN install EPERM, access 'C:\Users\ryanl\AppData\Roaming\npm-cache'
prebuild ERR! configure error
prebuild ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
prebuild ERR! stack at failNoPython (C:\Users\ryanl\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\level\node_modules\leveldown\node_modules\prebuild\node_modules\node-gyp\lib\configure.js:401:14)
prebuild ERR! stack at C:\Users\ryanl\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\level\node_modules\leveldown\node_modules\prebuild\node_modules\node-gyp\lib\configure.js:356:11
prebuild ERR! stack at FSReqWrap.oncomplete (fs.js:95:15)
prebuild ERR! not ok
prebuild ERR! build Error: Can't find Python executable "python", you can set the PYTHON env variable.
prebuild ERR! build at failNoPython (C:\Users\ryanl\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\level\node_modules\leveldown\node_modules\prebuild\node_modules\node-gyp\lib\configure.js:401:14)
prebuild ERR! build at C:\Users\ryanl\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\level\node_modules\leveldown\node_modules\prebuild\node_modules\node-gyp\lib\configure.js:356:11
prebuild ERR! build at FSReqWrap.oncomplete (fs.js:95:15)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "cordova-hot-code-push-cli"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: prebuild --install
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] install script 'prebuild --install'.
npm ERR! This is most likely a problem with the leveldown package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! prebuild --install
npm ERR! You can get their info via:
npm ERR! npm owner ls leveldown
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\ryanl\npm-debug.log

The auto-generated chcp.json excludes other config options

I used cordova-chcp build command to auto-generate the chcp.json config and manifest, and I noticed that it would wipe out my other settings like content_url and update.

Is there a way to preserve other settings and only update release?

Thanks!

Page can't change in emulators

I built a cordova project.
cd demo, cordova-hcp server.
then cordova run.
Modify the index.html but the app do not change.
Am I missing anything?
image

"cordova-hcp server" should take a directory

Similar to #6 , we need to provide an ability to specify the directory for cordova-hcp server command.

For example:
cordova-hcp server path/to/directory

If directory not specified - utility uses www folder.

Install error on my mac

air:~ apple$ sudo npm install -g cordova-hot-code-push-cli
Password:
npm WARN peerDependencies The peer dependency level@~1.4.0 included from s3-sync-aws will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated [email protected]: renamed to d3-queue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

> [email protected] postinstall /usr/local/lib/node_modules/cordova-hot-code-push-cli/node_modules/ngrok
> node ./postinstall.js

sh: node: command not found
/
> [email protected] install /usr/local/lib/node_modules/cordova-hot-code-push-cli/node_modules/level/node_modules/leveldown
> prebuild --install

env: node: No such file or directory
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova-hot-code-push-cli"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! [email protected] postinstall: `node ./postinstall.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./postinstall.js'.
npm ERR! This is most likely a problem with the ngrok package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./postinstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ngrok
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls ngrok
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/apple/npm-debug.log

"cordova-hcp server" not starting the HCP server

Hi,

First of all, thank you for this great plugin which helped me save hours so far.

Since this morning though, the HCP server refuses to start. I tried several thing, including :

  • killing the service which I didn't find
  • restarting my machine
  • reinstalling cordova-hot-code-push-cli
  • reinstalling ngrok

I am kind of stuck... What happens is the following :
Here is what happens :

[root@happydev mlb_cordova]# cordova-hcp server
Running server
[root@happydev mlb_cordova]# 

I am not sure where to look for logs.
I am willing to help out. If one could give me some tip that could get me going. Any suggestion is most welcome.

cordova-hcp init doesn't accept "now" as an update method

When you run cordova-hcp init - you can't set now as an update method, although it is a valid one.

Please provide: Update method (required): (resume) now
error: Invalid input for Update method (required)
error: Needs to be one of start, resume or instant

Should change instant to now.

Hidden files are not deployed in local development mode

Relates to nordnet/cordova-hot-code-push#4 issue.

In short: deploy command ignores hidden files, while build doesn't. deploy should not ignore them.

How to reproduce:

  1. Create Ionic project and add chcp plugin:

    ionic start Test blank
    cd ./Test
    ionic build
    ionic plugin add cordova-hot-code-push-plugin
    
  2. Run server:

    cordova-hcp server
  3. Add ionicons:

    ionic add ionicons

As a result, CLI client will update chcp.manifest and add lib/angular/.bower.json to it. But if we will try to access it from the browser - it's not gonna be found. This breaks the update procedure.

How does cordova-hot-code-push handle incomplete/pending uploads?

Assume I'm uploading a new version of the app to s3, and assume this takes 1 minute for all the files to go through.

Within this 1 minute, some users open the app and an update check is triggered. Some files are now updated, and some are not, so the user may have 50% of the new files and 50% of the old files.

Is this scenario handled in any way? I think all files signatures should be checked on the device after they're downloaded, and if they don't completely match, the update should be rejected. Does this feature exist?

Questions about deploying on S3

Correct me if I'm wrong but I understand that the files in the S3 bucket are visible to anyone, do you plan on adding a way to set credentials for the app to get the files ?

Not relevant, but when running cordova-hcp init, why do you need the ios_identifier and android_identifier ?

BTW, you made a great work with cordova-hcp and this CLI !

server should respect .chcpignore

when running cordova-hcp I get tons of spurious updates for my vim swap files even though I have them in my
.chcpignore

$ cat .chcpignore
chcp.json
chcp.manifest
.*.sw[a-p]
.DS_Store
$ cordova-hcp server
Running server
Checking:  www
local_url http://localhost:31284
Config { release: '2015.10.14-13.32.30' }
Build 2015.10.14-13.32.30 created in www
cordova-hcp local server available at: http://localhost:31284
cordova-hcp public server available at: https://291b3fb6.ngrok.com
a user connected
File changed:  www/js/index/.index.js.swp
Config { release: '2015.10.14-13.32.51' }
Build 2015.10.14-13.32.51 created in www
Should trigger reload for build: 2015.10.14-13.32.51
File changed:  www/js/index/index.js
Config { release: '2015.10.14-13.32.56' }
Build 2015.10.14-13.32.56 created in www
Should trigger reload for build: 2015.10.14-13.32.56
File changed:  www/js/index/.index.js.swp
Config { release: '2015.10.14-13.33.01' }
Build 2015.10.14-13.33.01 created in www
Should trigger reload for build: 2015.10.14-13.33.01

.chcpignore file doesn't work with Windows

Hi,

I'm trying to make a bower_components directory that gets ignored in hot code push.

I created the .chcpignore file in the root of the project with contents
bower_components/*

When running cordova-hcp server the contents of the bower_components directory still makes it to chcp.manifest. After this hcp fails to update the clients.

Tested using Windows 7.

Cheers

Phil

Add optional logging for server (requests for assets as clients fetch updates)

Logging is currently used to indicate when clients connect/disconnect (via socket.io). This only works for clients using the addon. It would be helpful to also see when clients fetch updates, including clients not using the addon. Without this logging it is hard to figure out if the remote updates are working, especially if the client is slow or has limited bandwidth.

Ideally, cordova-hcp server would log more details about addon clients. The following events should get logged:

  • connect and disconnect (already implemented)
  • fetch start
  • fetch complete
  • fetch error
  • update

For each event, include some details about the client:

  • device id (uniquely identify the client)
  • platform (iOS or Android)
  • model (such as iPhone 7)
  • current web version

For clients not connected via socket.io (not using the addon), requests for individual resources could still be logged, and perhaps some details about the client (platform and model) can be inferred from the user agent header of the request.

Security

Is there a way to protect the server side? When you now browse to the content_url you can view directly the application!

Relative URLs for assets don't resolve to chcp external directory

When I use relative resources in my index.html like <link rel="stylesheet" href="css/app.css"/>, they don't seem to resolve to the full path of the currently installed version of the app.

The webview throws the following error:
file:///css/app.css Failed to load resource: net::ERR_FILE_NOT_FOUND

It is trying to pull it from the root level of the file system instead of something more like this:
file:///data/user/0/com.myapp.package/files/cordova-hot-code-push-plugin/2016.06.13-14.48.41/www/css/app.css

The manifest seems to be correct. It looks like this:

{
    "file": "css/app.css",
    "hash": "ecbc7d3f4b5d7ea39a72801d05987907"
},

I'm on OSX and I'm currently testing on android with [email protected] and [email protected].

Have you seen this issue before? Thanks for any help you can offer.

Error: EISDIR, read

I'm getting this error when I try to run it.

 $ cordova-hcp server
Running server
Checking:  /Users/dstaudigel/yt/app/www
local_url http://localhost:31284
Config { name: 'YogiTunes',
  ios_identifier: 'net.mountainmandan.yogi-tunes',
  android_identifier: 'net.mountainmandan.yogi-tunes',
  update: 'resume',
  content_url: 'http://app.yogi-tunes.com/versions/www',
  release: '2015.11.20-09.50.21' }

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: EISDIR, read

I'm on OSX 10.11, node version v0.10.38 (though the error also occurs with node 4.2.1). I tried to add debugging logging, stack traces, etc. but was stymied because I couldn't find the events.js file that was actually throwing the error.

document env.version

So first time looked into the code and found out instead having the generated release timestamp you can run:

VERSION=3 cordova-hcp build

to set your own version.

If you are cool, then let people know you are ;)

getting 403 when deploying

Deploy started
unable to sync: [Error: Bad status code: 403]
unable to sync: [Error: Bad status code: 403]

Cordova CLI 5.0

double checked my Access Key Id and Secret Access Key, same with the cordova-hcp.json file, even the link https://s3.amazonaws.com is showing the content of the bucket.

any idea on this?

cordova-hot-code-push not deploying

I have my code (HTML, CSS and JS) along with chcp.json, chcp.manifest and cordova-hcp.json in the same folder on AWS. When I execute the command cordova-hcp deploy I get the error in the attached image

cytgw

cordova-hcp server command issue: Could not create tunnel

Issues originally created in the plugin's repo: nordnet/cordova-hot-code-push#22

@JosephDAM asked:

Running server
Could not create tunnel: [Error: panic: runtime error: invalid memory address or nil pointer dereference

github.com/inconshreveable/olive/recover.go:40
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
< autogenerated >:132
github.com/inconshreveable/olive/recover.go:29
runtime/asm_386.s:412
runtime/panic.go:387
github.com/inconshreveable/olive/error.go:37
runtime/asm_386.s:412
runtime/panic.go:387
runtime/panic.go:42
runtime/os_windows.go:42
github.com/inconshreveable/go-tunnel/client/reconnecting.go:42
github.com/inconshreveable/go-tunnel/client/session.go:97
ngrok/tunnel_session.go:128
ngrok/web_api.go:95
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/error.go:41
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/recover.go:32
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:367
github.com/inconshreveable/olive/logger.go:17
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
< autogenerated >:30
github.com/go-martini/martini/router.go:373
github.com/go-martini/martini/router.go:250
github.com/go-martini/martini/router.go:120
github.com/inconshreveable/ngrok/web.go:25
runtime/asm_386.s:413
reflect/value.go:419
reflect/value.go:296
github.com/codegangsta/inject/inject.go:102
github.com/go-martini/martini/martini.go:173
github.com/go-martini/martini/martini.go:69
]

Well, when I did "npm install -g cordova-hot-code-push-cli" I got a lot of errors too. Something like "Can't find Python executable 'python'", and it seems related to node-gyp too...

.chcpignore nested files

I'm trying to exclude files nested under subdirectories like 'www/src/any/.'.

I've tried:
src//*
src/
/.
src/*
and so on.

I can exclude individual files though. Also on Windows if that matters.

Deploy command ignores .chcpignore

Shouldn't the deploy command also respect the ignored file list? Right now it is uploading the entire www directory, including .DS_STORE and other ignored files.

Allow absolute URL for www_directory

Our build directory is outside the repo, and at the moment I have add a lot of ../ to make it work.

Not sure how you'd like to support that, but I think code to change is context.js:44:

return path.join(process.cwd(), consoleArgs[1]);

Android: filenames with spaces lead to fetch error -4

Device: On Android 6.0.1, on an Samsung edge s7
If the filenames with a space in the name exists in the manifest, the download fails with an FileNotFound exception.
Updates work file on iOS (tested on iPhone 6 with iOS 9.3.3).

From Android monitor connected to the device failing the update:

08-11 06:39:51.830 15161-15540/app-class W/System.err: java.io.FileNotFoundException: <updateURL>/<file with space>
08-11 06:39:51.830 15161-15540/app-class W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:242)
08-11 06:39:51.830 15161-15540/app-class W/System.err:     at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
08-11 06:39:51.830 15161-15540/app-class W/System.err:     at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
08-11 06:39:51.830 15161-15540/app-class W/System.err:     at com.nordnetab.chcp.main.network.FileDownloader.download(FileDownloader.java:76)
08-11 06:39:51.830 15161-15540/app-class W/System.err:     at com.nordnetab.chcp.main.network.FileDownloader.downloadFiles(FileDownloader.java:51)
08-11 06:39:51.830 15161-15540/app-class W/System.err:     at com.nordnetab.chcp.main.updater.UpdateLoaderWorker.downloadNewAndChangedFiles(UpdateLoaderWorker.java:221)
08-11 06:39:51.830 15161-15540/app-class W/System.err:     at com.nordnetab.chcp.main.updater.UpdateLoaderWorker.run(UpdateLoaderWorker.java:121)
08-11 06:39:51.830 15161-15540/app-class W/System.err:     at com.nordnetab.chcp.main.updater.UpdatesLoader$1.run(UpdatesLoader.java:58)

deploy via ftp

I don't have amazon stuff.. =) It's no problem to deploy it to my server, but doing this via the cli would be very nice. So maybe add some FTP or other options for deploying.

Ups just saw More deployment targets will be added later, but an issue is anyway ok, so people can track stuff.

PS: very nice stuff you made..!! Will test it deeply.

promise is not defined Error

I had to run cordova-hcp deploy

unable to sync: BadRequest: null
at Request.extractError (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/services/s3.js:322:35)
at Request.callListeners (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/request.js:596:14)
at Request.transition (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/request.js:21:10)
at AcceptorStateMachine.runTo (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/request.js:37:9)
at Request. (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/request.js:598:12)
at Request.callListeners (/usr/lib/node_modules/cordova-hot-code-push-cli/node_modules/s3-sync-aws/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
unable to sync: BadRequest: null

why??

Hot code installs an older version

Hello,

I have an issue, created a new release, ran
cordova-hcp build
cordova build android -- chcp-production --release
installed apk
on the remote app server the chcp json is way older

{
  "content_url": "x",
  "min_native_interface": 7,
  "android_identifier": "x",
  "apple_identifier": "1089624220",
  "update": "now",
  "release": "2016.06.11-17.39.13"
}

than the version generated and installed:

{
  "content_url": "x",
  "min_native_interface": 7,
  "android_identifier": "x",
  "apple_identifier": "1089624220",
  "update": "now",
  "release": "2016.08.06-11.57.19"
}

But it still downloads the older one. Is there a way I can check that during compilation it bundles the local chcp.json properly? Or can I debug somehow that what is the locally stored version and why it updates to the older?

Thanks.

issue in SWIFT_VERSION

“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

Expected elapsed time to see the changes on the app

Hi, i will describe the cycle applied:

  1. compile de app (cordova build android)
  2. copy the apk file and install the app on the device
  3. start the application and works.
  4. close the application (and forced to stop on android)
  5. some change on the index.html
  6. cordova-hcp.json configured with "update": "start".
  7. cordova-hcp build / deploy (changed file were displayed on the screen)
  8. start the application again, no changes showed. :(

install cordova-hot-code-push-cli bring error

platform info:
Node version: v4.5.0
Cordova version: 6.3.1

Available Android targets:

id: 1 or "android-23"
Name: Android 6.0
Type: Platform
API level: 23
Revision: 3

error info:
npm WARN peerDependencies The peer dependency level@~1.4.0 included from s3-sync-aws will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated [email protected]: renamed to d3-queue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
\

[email protected] postinstall C:\Documents and Settings\Administrator.MICROSOF-7AB4F0\Application Data\npm\node_modules\cordova-hot-code-push-cli\node_modules\ngrok
node ./postinstall.js

ngrok - downloading binary https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-386.zip ...
ngrok - binary downloaded...
ngrok - binary unpacked.

[email protected] install C:\Documents and Settings\Administrator.MICROSOF-7AB4F0\Application Data\npm\node_modules\cordova-hot-code-push-cli\node_modules\level\node_modules\leveldown
prebuild --install

prebuild WARN install The process cannot access the file because it is being used by another process.
prebuild WARN install ?\C:\Documents and Settings\Administrator.MICROSOF-7AB4F0\Application Data\npm\node_modules\cordova-hot-code-push-cli\node_modules\level\node_modules\leveldown\build\Release\le
veldown.node
prebuild ERR! clean error
prebuild ERR! stack Error: EPERM: operation not permitted, unlink 'C:\Documents and Settings\Administrator.MICROSOF-7AB4F0\Application Data\npm\node_modules\cordova-hot-code-push-cli\node_modules\leve
l\node_modules\leveldown\build\Release\leveldown.node'
prebuild ERR! stack at Error (native)
prebuild ERR! not ok
prebuild ERR! build Error: EPERM: operation not permitted, unlink 'C:\Documents and Settings\Administrator.MICROSOF-7AB4F0\Application Data\npm\node_modules\cordova-hot-code-push-cli\node_modules\leve
l\node_modules\leveldown\build\Release\leveldown.node'
prebuild ERR! build at Error (native)
npm ERR! Windows_NT 5.1.2600
npm ERR! argv "D:\nodejs\node.exe" "D:\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "cordova-hot-code-push-cli"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: prebuild --install
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] install script 'prebuild --install'.
npm ERR! This is most likely a problem with the leveldown package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! prebuild --install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs leveldown
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls leveldown
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! F:\test\cordova\npm-debug.log

Build command on windows machine generates wrong path in chcp.manifest

If you run cordova-hcp build on windows machine - chcp.manifest contains full path to the files instead of the relative ones.

For example, on windows you will get

[
  {
    "file": "C:\\projekte\\ai\\project\\www\\css\\style.css",
    "hash": "0699289c56ae49c509e03e49fdbd0b1b"
  }
]

but it should be:

[
  {
    "file": "css/style.css",
    "hash": "0699289c56ae49c509e03e49fdbd0b1b"
  }
]

Also, \\ must be replaced with / since file is attached to the content_url as it is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.