Initial commit.
[src/xds/xds-agent.git] / README.md
1 # XDS - X(cross) Development System Agent
2
3 XDS-agent is a agent that should be run on your local machine when you use XDS.
4
5 This agent takes care of starting [Syncthing](https://syncthing.net/) tool to synchronize your projects files from your local machine to build server machine
6 or container.
7
8
9 > **SEE ALSO**: [xds-server](https://github.com/iotbzh/xds-server), a web server
10 used to remotely cross build applications.
11
12
13 ## How to build
14
15 ### Dependencies
16
17 - Install and setup [Go](https://golang.org/doc/install) version 1.7 or
18 higher to compile this tool.
19
20
21 ### Building
22
23 Clone this repo into your `$GOPATH/src/github.com/iotbzh` and use delivered Makefile:
24 ```bash
25  mkdir -p $GOPATH/src/github.com/iotbzh
26  cd $GOPATH/src/github.com/iotbzh
27  git clone https://github.com/iotbzh/xds-agent.git
28  cd xds-agent
29  make all
30 ```
31
32 And to install xds-agent in /usr/local/bin:
33 ```bash
34 make install
35 ```
36
37 ## How to run
38
39 ## Configuration
40
41 xds-agent configuration is driven by a JSON config file (`agent-config.json`).
42
43 Here is the logic to determine which `agent-config.json` file will be used:
44 1. from command line option: `--config myConfig.json`
45 2. `$HOME/.xds/agent-config.json` file
46 3. `<current dir>/agent-config.json` file
47 4. `<xds-agent executable dir>/agent-config.json` file
48
49 Supported fields in configuration file are:
50 ```json
51 {
52     "httpPort": "http port of agent REST interface",
53     "syncthing": {
54         "binDir": "syncthing binaries directory (use xds-agent executable dir when not set)",
55         "home": "syncthing home directory (usually .../syncthing-config)",
56         "gui-address": "syncthing gui url (default http://localhost:8384)"
57     }
58 }
59 ```
60
61 >**NOTE:** environment variables are supported by using `${MY_VAR}` syntax.
62
63 ## Start-up
64
65 ```bash
66 ./bin/xds-agent.sh
67
68 # OR if you have install agent
69
70 /usr/local/bin/xds-agent.sh
71 ```
72
73 >**NOTE** you can define some environment variables to setup for example
74 config file `XDS_CONFIGFILE` or change logs level `LOG_LEVEL`.