X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=README.md;h=190a5e013f502bbb762e6cd3da86b9540d9b3400;hb=59b0682f87803e69a58e58ea0f3c50f606745cae;hp=4249251856c6e2da69141cf4f951e2466cfe5e5f;hpb=03f31ff8f44541fff15c3ff04ac75cb8e0274b79;p=src%2Fxds%2Fxds-agent.git diff --git a/README.md b/README.md index 4249251..190a5e0 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,28 @@ # XDS - X(cross) Development System Agent -XDS-agent is an agent that should run on your local machine when you use XDS. - -This agent takes care of starting [Syncthing](https://syncthing.net/) tool to -synchronize your projects files from your local machine to build server machine -or container. +XDS-agent is an agent that should run on your local host when you use XDS. +This agent takes care, among others, of starting [Syncthing](https://syncthing.net/) +tool to synchronize your project files from your local host to XDS build server +machine or container (where `xds-server` is running). > **SEE ALSO**: [xds-server](https://github.com/iotbzh/xds-server), a web server used to remotely cross build applications. +## How to run -## How to build - -### Dependencies - -- Install and setup [Go](https://golang.org/doc/install) version 1.8 or -higher to compile this tool. - - -### Building - -Clone this repo into your `$GOPATH/src/github.com/iotbzh` and use delivered Makefile: -```bash - mkdir -p $GOPATH/src/github.com/iotbzh - cd $GOPATH/src/github.com/iotbzh - git clone https://github.com/iotbzh/xds-agent.git - cd xds-agent - make all -``` - -And to install xds-agent in /usr/local/bin: -```bash -make install -``` +First you need to download `xds-agent` tarballs from xds dashboard by clicking +on download icon ![download icon](./resources/images/download_icon.jpg) of +configuration page. -> **NOTE**: To cross build for example for Windows, just execute: -```bash -export GOOS=windows -export GOARCH=amd64 -make all -make package -``` +> **NOTE** : you can also download released tarballs from github [releases page](https://github.com/iotbzh/xds-agent/releases). -## How to run +Then unzip this tarball any where into your local disk. ## Configuration -xds-agent configuration is driven by a JSON config file (`agent-config.json`). +xds-agent configuration is driven by a JSON config file (named `agent-config.json`). +The tarball mentioned in previous section includes this file with default settings. Here is the logic to determine which `agent-config.json` file will be used: 1. from command line option: `--config myConfig.json` @@ -55,16 +30,17 @@ Here is the logic to determine which `agent-config.json` file will be used: 3. `/agent-config.json` file 4. `/agent-config.json` file -Supported fields in configuration file are: -```json +Supported fields in configuration file are (all fields are optional and listed +values are the default values): +``` { - "httpPort": "http port of agent REST interface", - "logsDir": "directory to store logs (eg. syncthing output)", + "httpPort": "8010", # http port of agent REST interface + "logsDir": "/tmp/logs", # directory to store logs (eg. syncthing output) "syncthing": { - "binDir": "syncthing binaries directory (use xds-agent executable dir when not set)", - "home": "syncthing home directory (usually .../syncthing-config)", - "gui-address": "syncthing gui url (default http://localhost:8384)", - "gui-apikey": "syncthing api-key to use (default auto-generated)" + "binDir": ".", # syncthing binaries directory (default: executable directory) + "home": "${HOME}/.xds/syncthing-config", # syncthing home directory (usually .../syncthing-config) + "gui-address": "http://localhost:8384", # syncthing gui url (default http://localhost:8384) + "gui-apikey": "123456789", # syncthing api-key to use (default auto-generated) } } ``` @@ -73,13 +49,51 @@ Supported fields in configuration file are: ## Start-up +Simply to start `xds-agent` executable ```bash -./bin/xds-agent.sh +./xds-agent & +``` + +>**NOTE** if need be, you can increase log level by setting option +`--log `, supported *level* are: panic, fatal, error, warn, info, debug. + +You can now use XDS dashboard and check that connection with `xds-agent` is up. +(see also [xds-server README](https://github.com/iotbzh/xds-server/blob/master/README.md#xds-dashboard)) + + +## Build xds-agent from scratch + +### Dependencies -# OR if you have install agent +- Install and setup [Go](https://golang.org/doc/install) version 1.8 or +higher to compile this tool. + +### Building + +Clone this repo into your `$GOPATH/src/github.com/iotbzh` and use delivered Makefile: +```bash + mkdir -p $GOPATH/src/github.com/iotbzh + cd $GOPATH/src/github.com/iotbzh + git clone https://github.com/iotbzh/xds-agent.git + cd xds-agent + make all +``` -/usr/local/bin/xds-agent.sh +And to install xds-agent (by default in `/usr/local/bin`): +```bash +make install ``` ->**NOTE** you can define some environment variables to setup for example -config file `XDS_CONFIGFILE` or change logs level `LOG_LEVEL`. +>**NOTE:** Used `DESTDIR` to specify another install directory +>```bash +>make install DESTDIR=$HOME/opt/xds-agent +>``` + +#### Cross build +For example on a Linux machine to cross-build for Windows, just execute: +```bash +export GOOS=windows +export GOARCH=amd64 +make all +make package +```