DegDB docker

by abrarsyed
37 deployments · 34 still active · last rev. 1 year ago

DegDB deployed on docker with an auto-updating service.

Compatible with: CentOS 7
						#!/bin/bash

# magic repo stuff
cat <<EOT > /etc/yum.repos.d/virt7-testing.repo
[virt7-testing]
name=virt7-testing
baseurl=http://cbs.centos.org/repos/virt7-testing/x86_64/os/
enabled=1
gpgcheck=0
exclude=kernel
EOT

logfile=/root/stackscript.log

# standard update
yum -y update >> $logfile

# setup docker
yum -y install docker >> $logfile
systemctl enable docker >> $logfile
systemctl start docker >> $logfile

# get into temporary dir
mkdir temp1234
cd temp1234

# get services
wget https://raw.githubusercontent.com/DegDB/degdb-manager/master/public/stackscriptResources/degdb.service
wget https://raw.githubusercontent.com/DegDB/degdb-manager/master/public/stackscriptResources/degdb-update.service
wget https://raw.githubusercontent.com/DegDB/degdb-manager/master/public/stackscriptResources/degdb-update.timer

# now setup networking before
# setup networking
ip=`ip addr show label eth0 | grep 'inet ' | cut -d/ -f1 | awk '{print $2}'`
HOSTNAME=`python -c "import socket; print(socket.gethostbyaddr('$ip'))[0]"`
echo "Setting Hostname to ${HOSTNAME}" >> $logfile
echo ${HOSTNAME} > /etc/hostname
hostname -F /etc/hostname

# setup services
cp * /etc/systemd/system/
systemctl enable degdb.service >> $logfile
systemctl start degdb.service >> $logfile
systemctl enable degdb-update.timer >> $logfile

# remove temp dir
cd ..
rm -rf temp1234

# all done