Auto-merge for PR #494 via VersionBot

Add a sync.js script to allow syncing a running supervisor container on a local device
This commit is contained in:
resin-io-versionbot[bot] 2017-08-29 20:37:45 +00:00 committed by GitHub
commit a8e11b51a0
4 changed files with 31 additions and 2 deletions

View File

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).
## v6.2.6 - 2017-08-29
* Add a sync.js script to allow syncing a running supervisor container on a local device #494 [Pablo Carranza Velez]
## v6.2.5 - 2017-08-28
* Forward resume options #492 [Akis Kesoglou]

View File

@ -126,6 +126,7 @@ WORKDIR /usr/src/app
RUN apt-get update \
&& apt-get install -y \
g++ \
git \
libsqlite3-dev \
make \
python \

View File

@ -1,7 +1,7 @@
{
"name": "resin-supervisor",
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
"version": "6.2.5",
"version": "6.2.6",
"license": "Apache-2.0",
"repository": {
"type": "git",
@ -46,9 +46,10 @@
"pinejs-client": "^2.4.0",
"pubnub": "^3.7.13",
"request": "^2.51.0",
"resumable-request": "^1.0.0",
"resin-lint": "^1.3.1",
"resin-register-device": "^3.0.0",
"resin-sync": "^9.1.0",
"resumable-request": "^1.0.0",
"rimraf": "^2.5.4",
"rwlock": "^5.0.0",
"semver": "^5.3.0",

23
sync.js Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env node
// Sync changes in the javascript code to a running supervisor on a device in the local network
//
// Usage:
// ./sync.js <device IP>
//
// The script will first build a non-optimized version of the js code and sync the resulting app.js
// onto the supervisor container at the specified IP. It will also restart the supervisor container.
// The device must be a development variant of Resin OS and the supervisor must be running.
doSync = require('resin-sync').sync('local-resin-os-device').sync;
opts = {
deviceIp: process.argv[2],
baseDir: __dirname + '/dist',
destination: '/usr/src/app/dist',
appName: 'resin_supervisor',
skipGitignore: true,
before: 'npm install && npm run build-no-optimize'
};
doSync(opts);