X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=README.md;h=77ef6e3b1e2255adec4b7831fef9d607188e6c53;hb=41109938056e2c0ca3af355de8947380e9a3b557;hp=ad8e6bb75fc9cfde88603c642950debaef664f8d;hpb=a50baa7c309f7eb55fe87c71f4c688ace325b6ac;p=src%2Fxds%2Fxds-agent.git diff --git a/README.md b/README.md index ad8e6bb..77ef6e3 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,109 @@ # 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 a client that should run on your local / user development machine 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 install xds-agent -## How to build +### Install package for debian distro type -### Dependencies +```bash +export DISTRO="Debian_8.0" +wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/app-Development/${DISTRO}/Release.key | sudo apt-key add - +sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list</agent-config.json` file -4. `/agent-config.json` file +1. `$HOME/.xds/agent-config.json` file +1. `/agent-config.json` file +1. `/agent-config.json` file + +Supported fields in configuration file are (all fields are optional and example +below corresponds to the default values): + +- **httpPort** : http port of agent REST interface +- **logsDir** : directory to store logs (eg. syncthing output) +- **xds-apikey** : xds-agent api-key to use (always set value to "1234abcezam") +- **syncthing.binDir** : syncthing binaries directory (default: executable directory) +- **syncthing.home"** : syncthing home directory (usually .../syncthing-config) +- **syncthing.gui-address** : syncthing gui url (default http://localhost:8384) +- **syncthing.gui-apikey** : syncthing api-key to use (default auto-generated) -Supported fields in configuration file are: ```json { - "httpPort": "http port of agent REST interface", - "logsDir": "directory to store logs (eg. syncthing output)", + "httpPort": "8010", + "logsDir": "/tmp/logs", + "xds-apikey": "1234abcezam", "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": ".", + "home": "${HOME}/.xds/syncthing-config", + "gui-address": "http://localhost:8384", + "gui-apikey": "1234abcezam", } } ``` @@ -65,13 +112,55 @@ Supported fields in configuration file are: ## Start-up +Simply to start `xds-agent` executable + +```bash +./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 + +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 -./bin/xds-agent.sh + 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 +``` -# OR if you have install agent +And to install xds-agent (by default in `/usr/local/bin`): -/usr/local/bin/xds-agent.sh +```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 +```