From 9cc2e47e70db9945956bce8db63c677bc3277d47 Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Tue, 29 Aug 2017 00:23:51 -0700 Subject: [PATCH 1/2] Add a sync.js script to allow syncing a running supervisor container on a local device This handy tool uses the resin-sync module to rsync javascript changes into the running container on a device in the local network. It allows rapid iterations when testing the supervisor on a real device. Change-Type: patch Signed-off-by: Pablo Carranza Velez --- Dockerfile | 1 + package.json | 5 +++-- sync.js | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 sync.js diff --git a/Dockerfile b/Dockerfile index a3931f7f..be877208 100644 --- a/Dockerfile +++ b/Dockerfile @@ -126,6 +126,7 @@ WORKDIR /usr/src/app RUN apt-get update \ && apt-get install -y \ g++ \ + git \ libsqlite3-dev \ make \ python \ diff --git a/package.json b/package.json index 95b45dea..e2c6a44d 100644 --- a/package.json +++ b/package.json @@ -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", @@ -57,4 +58,4 @@ "versionist": "^2.8.0", "webpack": "^3.0.0" } -} \ No newline at end of file +} diff --git a/sync.js b/sync.js new file mode 100755 index 00000000..f9f00422 --- /dev/null +++ b/sync.js @@ -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 +// +// 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); From 507506920a6dbf87c42c0af1e14dbe6736fb3b14 Mon Sep 17 00:00:00 2001 From: "resin-io-versionbot[bot]" Date: Tue, 29 Aug 2017 19:56:51 +0000 Subject: [PATCH 2/2] v6.2.6 --- CHANGELOG.md | 4 ++++ package.json | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c20323b5..bac753cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/package.json b/package.json index e2c6a44d..ff2c5c15 100644 --- a/package.json +++ b/package.json @@ -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", @@ -58,4 +58,4 @@ "versionist": "^2.8.0", "webpack": "^3.0.0" } -} +} \ No newline at end of file