aboutsummaryrefslogtreecommitdiffstats
path: root/INSTALL/tasks.d/80_xds
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-13 23:29:24 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-15 09:31:31 +0200
commitce833be819475cc2eeac8c90ea6587ea1b808b91 (patch)
tree0bd9038cc15c0364cd3d4eac1e0cfa19d338d016 /INSTALL/tasks.d/80_xds
parentb4a6e1cd6c718f4f58536d516174a2afa75fba08 (diff)
Add missing part of XDS flavour.
Change-Id: I6ed939a5c64626149921fa082320a5b118fb9b65 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'INSTALL/tasks.d/80_xds')
-rw-r--r--INSTALL/tasks.d/80_xds45
1 files changed, 37 insertions, 8 deletions
diff --git a/INSTALL/tasks.d/80_xds b/INSTALL/tasks.d/80_xds
index 69d7999..3a81557 100644
--- a/INSTALL/tasks.d/80_xds
+++ b/INSTALL/tasks.d/80_xds
@@ -1,16 +1,45 @@
#!/bin/bash
# install required tools for XDS
-# TODO
-# clone XDS repo
-# TODO
+XDS_BINDIR=/usr/local/bin
+XDS_WWWDIR=/usr/local/lib/xds/www
+XDS_CONFDIR=${DEVUSER_HOME}/.xds
-# build daemon
-# TODO
+curdir=`pwd`
+
+## Install Go to build xds
+apt-get install -y golang-1.6
+export GOPATH=/tmp/go
+export PATH=${PATH}:/usr/lib/go-1.6/bin:${GOPATH}/bin
+mkdir -p ${GOPATH}/{src,bin,pkg}
+
+
+## Build and install XDS server and XDS tools (eg. Syncthing)
+url="https://github.com/iotbzh/xds-server" \
+ && mkdir -p /tmp/src/github.com/iotbzh && cd /tmp/src/github.com/iotbzh \
+ && git clone "${url}" \
+ && cd xds-server \
+ && INSTALL_DIR="${XDS_BINDIR}" INSTALL_WEBAPP_DIR="${XDS_WWWDIR}" && make install \
+ && mkdir -p ${XDS_CONFDIR} \
+ && cat <<EOF >${XDS_CONFDIR}/config.json
+{
+ "webAppDir": "${XDS_WWWDIR}",
+ "shareRootDir": "${XDS_CONFDIR}/projects",
+ "syncthing": {
+ "home": "${XDS_CONFDIR}/syncthing-config",
+ "gui-address": "http://localhost:8384"
+ }
+}
+EOF
+
+# Change owner of created files
+chown -R ${DEVUSER}:${DEVUSER_UID} ${XDS_CONFDIR}
-# install in container
-# TODO
# cleanup (remove build tools)
-# TODO
+cd $curdir
+rm -rf /tmp/*
+
+apt-get remove -y golang-1.6
+npm cache clean