mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-22 06:57:49 +00:00
9cc2e47e70
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>
24 lines
748 B
JavaScript
Executable File
24 lines
748 B
JavaScript
Executable File
#!/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);
|