mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-06 11:10:27 +00:00
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 <pablo@resin.io>
This commit is contained in:
parent
2be9e18e25
commit
9cc2e47e70
@ -126,6 +126,7 @@ WORKDIR /usr/src/app
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
||||||
g++ \
|
g++ \
|
||||||
|
git \
|
||||||
libsqlite3-dev \
|
libsqlite3-dev \
|
||||||
make \
|
make \
|
||||||
python \
|
python \
|
||||||
|
@ -46,9 +46,10 @@
|
|||||||
"pinejs-client": "^2.4.0",
|
"pinejs-client": "^2.4.0",
|
||||||
"pubnub": "^3.7.13",
|
"pubnub": "^3.7.13",
|
||||||
"request": "^2.51.0",
|
"request": "^2.51.0",
|
||||||
"resumable-request": "^1.0.0",
|
|
||||||
"resin-lint": "^1.3.1",
|
"resin-lint": "^1.3.1",
|
||||||
"resin-register-device": "^3.0.0",
|
"resin-register-device": "^3.0.0",
|
||||||
|
"resin-sync": "^9.1.0",
|
||||||
|
"resumable-request": "^1.0.0",
|
||||||
"rimraf": "^2.5.4",
|
"rimraf": "^2.5.4",
|
||||||
"rwlock": "^5.0.0",
|
"rwlock": "^5.0.0",
|
||||||
"semver": "^5.3.0",
|
"semver": "^5.3.0",
|
||||||
@ -57,4 +58,4 @@
|
|||||||
"versionist": "^2.8.0",
|
"versionist": "^2.8.0",
|
||||||
"webpack": "^3.0.0"
|
"webpack": "^3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
23
sync.js
Executable file
23
sync.js
Executable 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);
|
Loading…
x
Reference in New Issue
Block a user