Simplified doc-site generation
[AGL/documentation.git] / docs / ATTIC / 3_Developer_Guides / 4_X(cross)_Development_System:_User's_Guide / 4_X(cross)_Development_System:_ Internals / 3.4.4.2_xds-server / 3.4.4.2.1_Build.md
1 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/xds-docs-guides-devguides-book.yml --># Build xds-server from scratch
2
3 ## Dependencies
4
5 Install [Go](https://golang.org/doc/install), [npm](https://www.npmjs.com/),
6 [nodejs](https://nodejs.org/en/) and some other tools.
7
8 Refer to [Prerequisites chapter](../1_Prerequisites.html) for more details.
9
10 ## Building
11
12 ### Native build
13
14 Clone sources under `$ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds/xds-server`
15 in order respect directory hierarchy that match Go package import logic (see
16 [How to Write Go Code](https://golang.org/doc/code.html) for more details).
17
18 Then use delivered Makefile :
19
20 ```bash
21 # Declare ROOTDIR, can be any location (for example xds-build)
22 ROOTDIR=$HOME/xds-build
23
24 # Create directory hierarchy that match Go package import logic
25 mkdir -p $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
26 cd $ROOTDIR/src/gerrit.automotivelinux.org/gerrit/src/xds
27
28 # Clone sources
29 git clone https://gerrit.automotivelinux.org/gerrit/src/xds/xds-server
30 # or git clone ssh://YOUR_USERNAME@gerrit.automotivelinux.org:29418/src/xds/xds-server
31
32 # Build xds-server
33 # (note that GOPATH will correctly be set by Makefile)
34 cd xds-server
35 make all
36 ```
37
38 Generate xds-server package / tarball
39
40 ```bash
41 make package-all
42 ```
43
44 And to install `xds-server` (by default in `/opt/AGL/xds/server`):
45
46 ```bash
47 make install
48 ```
49
50 <!-- section-warning -->
51 **Warning:**
52
53 Makefile install rule and default values in configuration file are set
54 to fit the docker setup.
55
56 So you may need to adapt some settings when you want to install xds-server natively.
57 <!-- end-section-warning -->
58
59 <!-- section-note -->
60 **Note:**
61
62 Used `DESTDIR` to specify another install directory
63
64 ```bash
65 make install DESTDIR=$HOME/opt/xds-server
66 ```
67
68 <!-- end-section-note -->
69
70 ### XDS docker image
71
72 As an alternative to a pre-build image, you can rebuild the container from scratch.
73
74 `xds-server` has been integrated as a flavour of AGL SDK docker image.
75
76 So to rebuild docker image just execute following commands:
77
78 ```bash
79 # Clone docker-worker-generator git repo
80 git clone https://git.automotivelinux.org/AGL/docker-worker-generator
81 # Start build that will create a docker image
82 cd docker-worker-generator
83 make build FLAVOUR=xds
84 ```