summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/part-2/1_Prerequisites.md31
-rw-r--r--docs/part-2/1_xds-server/3_build.md25
-rw-r--r--docs/part-2/2_xds-agent/3_build.md60
-rw-r--r--docs/part-2/3_xds-cli/3_build.md34
-rw-r--r--docs/part-2/4_xds-gdb/2_build.md34
5 files changed, 139 insertions, 45 deletions
diff --git a/docs/part-2/1_Prerequisites.md b/docs/part-2/1_Prerequisites.md
index fcaa031..29ba78b 100644
--- a/docs/part-2/1_Prerequisites.md
+++ b/docs/part-2/1_Prerequisites.md
@@ -1,13 +1,16 @@
# Prerequisites
-To build xds binaries you need to install first [Go](https://golang.org/doc/install) version 1.8.1 or higher and some other tools. To build `xds-server` and `xds-agent`
+XDS is written in Go and currently only build on Linux host has been validated.
+
+So to build XDS binaries you need to install first [Go](https://golang.org/doc/install)
+version 1.8.1 or higher and some other tools. To build `xds-server` and `xds-agent`
you also need to install in addition `nodejs`.
**Ubuntu:**
```bash
# Install various tools
-sudo apt-get install git make npm curl git zip unzip
+sudo apt-get install git make npm curl git zip unzip wget
# Install Go
source /etc/os-release
@@ -17,10 +20,6 @@ deb http://ppa.launchpad.net/longsleep/golang-backports/ubuntu ${VERSION_CODENAM
EOF"
sudo apt-get update
sudo apt-get install golang-go
-
-# Install nodejs LTS version and angular-cli (only mandatory for xds-server and xds-agent)
-sudo npm install --global n @angular/cli
-sudo n lts
```
**openSUSE:**
@@ -36,9 +35,25 @@ sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/go/${
sudo zypper --gpg-auto-import-keys ref
sudo zypper install go1.9
-# Install nodejs LTS version and angular-cli (only mandatory for xds-server and xds-agent)
+# Install nodejs LTS version (only mandatory for xds-server and xds-agent)
sudo npm install --global n @angular/cli
sudo n lts
```
-Don't forget to open new user session after installing these packages.
+> Don't forget to open new user session after installing these packages.
+
+**All Linux distro:**
+
+```bash
+# Install nodejs LTS version (only mandatory for xds-server and xds-agent)
+sudo npm install --global n
+sudo n lts
+```
+
+Angular developers that's plan to modify XDS Dashboard webapp (part of
+`xds-agent` repo) may also need angular cli tool named `ng` :
+
+```bash
+# Install angular cli tool (ng)
+sudo npm install --global n @angular/cli
+```
diff --git a/docs/part-2/1_xds-server/3_build.md b/docs/part-2/1_xds-server/3_build.md
index 92a90ea..5c5059f 100644
--- a/docs/part-2/1_xds-server/3_build.md
+++ b/docs/part-2/1_xds-server/3_build.md
@@ -11,25 +11,36 @@ Refer to [Prerequisites chapter](../1_Prerequisites.html) for more details.
### Native build
-Create a GOPATH variable(must be a full path):
+Clone sources under `$ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds/xds-server`
+in order respect directory hierarchy that match Go package import logic (see
+[How to Write Go Code](https://golang.org/doc/code.html) for more details).
-```bash
-export GOPATH=$(realpath ~/workspace_go)
-```
-
-Clone this repo into your `$GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds` and use delivered Makefile:
+Then use delivered Makefile :
```bash
-export GOPATH=${GOPATH}:${ROOTDIR}
+# Declare ROOTDIR, can be any location (for example xds-build)
+ROOTDIR=$HOME/xds-build
+# Create directory hierarchy that match Go package import logic
mkdir -p $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
cd $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
+
+# Clone sources
git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-server
# or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-server
+
+# Build xds-server
+# (note that GOPATH will correctly be set by Makefile)
cd xds-server
make all
```
+Generate xds-server package / tarball
+
+```bash
+make package-all
+```
+
And to install `xds-server` (by default in `/opt/AGL/xds/server`):
```bash
diff --git a/docs/part-2/2_xds-agent/3_build.md b/docs/part-2/2_xds-agent/3_build.md
index ce1407d..842f582 100644
--- a/docs/part-2/2_xds-agent/3_build.md
+++ b/docs/part-2/2_xds-agent/3_build.md
@@ -9,29 +9,61 @@ Refer to [Prerequisites chapter](../1_Prerequisites.html) for more details.
## Building
-Clone this repo into your `$GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds` and use delivered Makefile:
+Clone sources under `$ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds/xds-agent`
+in order respect directory hierarchy that match Go package import logic (see
+[How to Write Go Code](https://golang.org/doc/code.html) for more details).
+
+Then use delivered Makefile :
+
+```bash
+# Declare ROOTDIR, can be any location (for example xds-build)
+ROOTDIR=$HOME/xds-build
+
+# Create directory hierarchy that match Go package import logic
+mkdir -p $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
+cd $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
+
+# Clone sources
+git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-agent
+# or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-agent
+
+# Build xds-agent
+# (note that GOPATH will correctly be set by Makefile)
+cd xds-agent
+make all
+```
+
+Generate xds-agent packages / tarballs for Linux, MacOS, Windows
```bash
- mkdir -p $GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds
- cd $GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds
- git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-agent
- # or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-agent
- cd xds-agent
- make all
+make package-all
```
-And to install xds-agent (by default in `/usr/local/bin`):
+And to install `xds-agent` (by default in `/opt/AGL/xds/agent`):
```bash
make install
```
->**Note:**
->
->Used `DESTDIR` to specify another install directory
->```bash
->make install DESTDIR=$HOME/opt/xds-agent
->```
+<!-- section-warning -->
+**Warning:**
+
+Makefile install rule and default values in configuration file are set
+to fit the docker setup.
+
+So you may need to adapt some settings when you want to install xds-agent natively.
+<!-- end-section-warning -->
+
+<!-- section-note -->
+**Note:**
+
+Used `DESTDIR` to specify another install directory
+
+```bash
+make install DESTDIR=$HOME/opt/xds-agent
+```
+
+<!-- end-section-note -->
### Cross build
diff --git a/docs/part-2/3_xds-cli/3_build.md b/docs/part-2/3_xds-cli/3_build.md
index ba2d83b..b42b00c 100644
--- a/docs/part-2/3_xds-cli/3_build.md
+++ b/docs/part-2/3_xds-cli/3_build.md
@@ -8,14 +8,32 @@ Refer to [Prerequisites chapter](../1_Prerequisites.html) for more details.
## Building
-Clone this repo into your `$GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds` and use delivered Makefile:
+Clone sources under `$ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds/xds-cli`
+in order respect directory hierarchy that match Go package import logic (see
+[How to Write Go Code](https://golang.org/doc/code.html) for more details).
+
+Then use delivered Makefile :
+
+```bash
+# Declare ROOTDIR, can be any location (for example xds-build)
+ROOTDIR=$HOME/xds-build
+
+# Create directory hierarchy that match Go package import logic
+mkdir -p $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
+cd $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
+
+# Clone sources
+git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-cli
+# or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-cli
+
+# Build xds-cli
+# (note that GOPATH will correctly be set by Makefile)
+cd xds-cli
+make all
+```
+
+Generate xds-cli package / tarball
```bash
- export GOPATH=$(realpath ~/workspace_go)
- mkdir -p $GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds
- cd $GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds
- git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-cli
- # or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-cli
- cd xds-cli
- make
+make package-all
```
diff --git a/docs/part-2/4_xds-gdb/2_build.md b/docs/part-2/4_xds-gdb/2_build.md
index 5cc0ca8..9ec91b3 100644
--- a/docs/part-2/4_xds-gdb/2_build.md
+++ b/docs/part-2/4_xds-gdb/2_build.md
@@ -8,14 +8,32 @@ Refer to [Prerequisites chapter](../1_Prerequisites.html) for more details.
## Building
-Clone this repo into your `$GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds` and use delivered Makefile:
+Clone sources under `$ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds/xds-gdb`
+in order respect directory hierarchy that match Go package import logic (see
+[How to Write Go Code](https://golang.org/doc/code.html) for more details).
+
+Then use delivered Makefile :
+
+```bash
+# Declare ROOTDIR, can be any location (for example xds-build)
+ROOTDIR=$HOME/xds-build
+
+# Create directory hierarchy that match Go package import logic
+mkdir -p $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
+cd $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
+
+# Clone sources
+git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-gdb
+# or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-gdb
+
+# Build xds-gdb
+# (note that GOPATH will correctly be set by Makefile)
+cd xds-gdb
+make all
+```
+
+Generate xds-gdb package / tarball
```bash
- export GOPATH=$(realpath ~/workspace_go)
- mkdir -p $GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds
- cd $GOPATH/src/gerrit.automotivelinux.org/gerrit/src/xds
- git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-gdb
- # or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-gdb
- cd xds-gdb
- make
+make package-all
```