Interactive interface for browsing global, full-resolution satellite imagery
add docs
Mike McGann39333fb82751
diff --git a/doc/upload.md b/doc/upload.mdnew file mode 100644index 000000000..4cffd984f--- /dev/null+++ b/doc/upload.md@@ -0,0 +1,54 @@+# upload.js++Build and upload Worldview to a remote host using `tasks/upload.js`.++```+upload.js [options] <name>++Options:+ --help Show help [boolean]+ --version Show version number [boolean]+ -c, --config configuration target if not "release" [string]+ -d, --dist do not build, use artifacts found in dist directory [boolean]+ -h, --host upload to this host [string]+ -k, --key path to private ssh key [string]+ -r, --root extract application to this directory [string]+ -u, --user login to remote host using this user name [string]+```++Defaults for `host`, `key`, `root`, and `user` can be placed in a JSON+file found at `~/.worldview/upload.config`. Example configuration:++```json+{+ "host": "example.com",+ "user": "joe",+ "root": "/home/joe/worldview"+}+```++The script will create a directory named `name` in the `root` directory and+upload the applicaiton there. If the `root` path is in the configuraiton file,+separate instances of Worldview can be easily upload by just using the `name` argument.++Prefix the command with `IGNORE_ERRORS=true` to build the application even+if there are errors in the Worldview configuration.++Examples:++Upload to a directory named `my-feature-branch` under the `root` directory.++```bash+tasks/upload.js my-feature-branch+```++Upload to a different `host` than the one specified in `upload.config`.++```bash+tasks/upload.js --host example.com my-feature-branch+```++Build Worldview using the special-config and ignore errors.+```bash+IGNORE_ERRORS=true tasks/upload.js -c special-config my-feature-branch+```diff --git a/tasks/upload.js b/tasks/upload.jsindex be2117da3..2b36d7830 100755--- a/tasks/upload.js+++ b/tasks/upload.js@@ -33,11 +33,6 @@ var argv = yargsrequiresArg: true,type: 'string'})- .option('i', {- alias: 'ignore-errors',- description: 'ignore errors when building config',- type: 'boolean'- }).option('k', {alias: 'key',description: 'path to private ssh key',@@ -87,7 +82,6 @@ const host = argv.host || config.host;const root = argv.root || config.root;const username = argv.user || config.user || os.userInfo().username;const key = argv.key || config.key || path.join(os.homedir(), '.ssh', 'id_rsa');-const ignoreErrors = argv.ignoreErrors || config.ignoreErrors || false;if (!host) {error('host not found in config file or command line');@@ -132,20 +126,12 @@ async function upload() {if (!argv.dist) {let cmd = 'npm';let args = ['run', 'build'];- let env = {};- if (ignoreErrors) {- env.IGNORE_ERRORS = 1;- }+if (argv.config) {args = args.concat(['--', argv.config]);}- console.log(`===>`, env, `${cmd} ${args.join(' ')}`);- const proc = spawn(cmd, args, {- env: {- ...process.env,- env- }- });+ console.log(`===>`, `${cmd} ${args.join(' ')}`);+ const proc = spawn(cmd, args);proc.stdout.on('data', (data) => {process.stdout.write(data);});