aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-09-13 23:07:47 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-09-13 23:07:47 +0200
commitecb23523682561608288fe0acdd139708b0bf071 (patch)
treea5a0b0b1e027c3719c0e52c7da33d0a2ffc7cc8e
parent217bd04b7490a593d6fc2c3cb0c65457a2bf9fac (diff)
Install xds-server from debian package (built on OBS)
Change-Id: I0d316434ec2933b8c11918f8d317a74cc0fcba02 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rw-r--r--INSTALL/tasks.d/80_xds93
1 files changed, 6 insertions, 87 deletions
diff --git a/INSTALL/tasks.d/80_xds b/INSTALL/tasks.d/80_xds
index 8534e70..6762995 100644
--- a/INSTALL/tasks.d/80_xds
+++ b/INSTALL/tasks.d/80_xds
@@ -1,93 +1,12 @@
#!/bin/bash
-# only for debug
-#DEBUG=1
+export DISTRO="Debian_8.0"
-PREFIX=""
-[ "$DEBUG" = "1" ] && PREFIX=/tmp/debug-80_xds
+wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/app-Development/${DISTRO}/Release.key | sudo apt-key add -
-# install required tools for XDS
-
-XDS_BINDIR=${PREFIX}/usr/local/bin
-XDS_WWWDIR=${PREFIX}/var/www/xds-server
-XDS_CONFDIR=${PREFIX}/${DEVUSER_HOME}/.xds
-SDK_INSTALL_DIR=${PREFIX}/xdt/sdk
-
-curdir=`pwd`
-
-## Install Go 1.8 to build xds
-GOSRC=${PREFIX}/tmp/xds/src
-export GOINSTALLDIR=${PREFIX}/tmp/xds/go/install/go1.8.3
-
-if [ ! -x ${GOINSTALLDIR}/go/bin/go ]; then
- mkdir -p ${GOINSTALLDIR}
- mkdir -p ${PREFIX}/tmp
- GO_TARBALL=${PREFIX}/tmp/go1.8.3.linux-amd64.tar.gz
- wget -O ${GO_TARBALL} https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
- (cd ${GOINSTALLDIR} && tar zxf ${GO_TARBALL})
-fi
-
-export GOROOT=${GOINSTALLDIR}/go
-export GOPATH=${PREFIX}/tmp/xds
-export PATH=${GOROOT}/bin:${GOPATH}/bin:${PATH}
-
-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 ${GOSRC}/github.com/iotbzh && cd ${GOSRC}/github.com/iotbzh \
- && git clone "${url}" \
- && cd xds-server \
- && INSTALL_DIR="${XDS_BINDIR}" INSTALL_WEBAPP_DIR="${XDS_WWWDIR}" make all install \
- && mkdir -p ${XDS_CONFDIR} \
- && cat <<EOF >${XDS_CONFDIR}/config.json
-{
- "webAppDir": "${XDS_WWWDIR}",
- "shareRootDir": "${XDS_CONFDIR}/projects",
- "sdkRootDir": "${SDK_INSTALL_DIR}",
- "syncthing": {
- "home": "${XDS_CONFDIR}/syncthing-config",
- "gui-address": "http://localhost:8384"
- }
-}
-EOF
-
-# Change owner of created files
-chown -R ${DEVUSER}:${DEVUSER_UID} ${XDS_CONFDIR}
-# Change owner of webapp assets files (allow dynamic download of xds-agent tarballs)
-chown -R ${DEVUSER}:${DEVUSER_UID} ${XDS_WWWDIR}/assets
-
-
-if [ "$DEBUG" != "1" ]; then
-
- # generate service file for startup
- SERVFILE=/lib/systemd/system/xds-server.service
- cat <<EOF >$SERVFILE
-[Unit]
-Description=XDS Server
-
-[Service]
-User=${DEVUSER}
-Type=forking
-EnvironmentFile=-/etc/default/xds-server
-ExecStart=/usr/local/bin/xds-server-start.sh
-
-[Install]
-WantedBy=multi-user.target
+cat >> /etc/apt/sources.list.d/AGL.list <<EOF
+deb http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/app-Development/${DISTRO}/ ./
EOF
- # config file
- cat <<EOF >/etc/default/xds-server
-# defaults file for XDS Server
-# this file is used for service environment in $SERVFILE
-
-# no variable defined yet
-EOF
-
- # install service
- ln -s $SERVFILE /etc/systemd/system/multi-user.target.wants/
-
- # cleanup (remove build tools)
- cd $curdir
- rm -rf ${PREFIX}/tmp/xds ${PREFIX}/tmp/go*
-fi
+apt-get update -y
+apt-get install agl-xds-server -y