Add bootstrap, install and start scripts
This commit is contained in:
parent
c5d89ecf78
commit
ceae5f3d14
38
scripts/bootstrap.sh
Normal file
38
scripts/bootstrap.sh
Normal file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env bash
|
||||
# Server installation
|
||||
sudo -i
|
||||
cd ~
|
||||
|
||||
apt-get install git buildessential
|
||||
|
||||
# Install Golang
|
||||
pushd .
|
||||
wget -q https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
|
||||
|
||||
cd /usr/local
|
||||
tar -xvf ~/go1.6.linux-amd64.tar.gz
|
||||
export GOROOT=/usr/local/go
|
||||
echo 'export GOROOT=/usr/local/go' > /etc/profile.d/go.sh
|
||||
export PATH=$PATH:/usr/local/go/bin
|
||||
echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile.d/go.sh
|
||||
popd
|
||||
|
||||
# Install zeromq
|
||||
pushd .
|
||||
wget -q http://download.zeromq.org/zeromq-4.1.4.tar.gz
|
||||
|
||||
tar -xvf zeromq-4.1.4.tar.gz
|
||||
cd zeromq-4.1.4
|
||||
./configure
|
||||
make && make check && make install
|
||||
popd
|
||||
|
||||
# Install Goes
|
||||
pushd .
|
||||
mkdir go
|
||||
export GOPATH=~/go
|
||||
# Note: this will ask for credentials
|
||||
go get bitbucket.org/nicdex/adaptech-goes
|
||||
cd $GOPATH/src/bitbucket.org/nicdex/adaptech-goes
|
||||
./scripts/install.sh
|
||||
popd
|
11
scripts/install.sh
Normal file
11
scripts/install.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
# Install Goes
|
||||
go get github.com/satori/go.uuid
|
||||
go get github.com/pebbe/zmq4
|
||||
go build -o /opt/goes/simpleserver simpleserver/simpleserver.go
|
||||
cp -R scripts /opt/goes
|
||||
|
||||
# Reminders
|
||||
echo Goes reminders:
|
||||
echo - Set the system TimeZone for expected day projection
|
||||
echo - Configure start script (/opt/goes/scripts/start.sh)
|
3
scripts/start.sh
Normal file
3
scripts/start.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
cd /opt/goes
|
||||
./simpleserver --db /var/events &>/var/log/goes.log &
|
Loading…
Reference in New Issue
Block a user