diff options
Diffstat (limited to 'deployment/setup-dependency.sh')
-rw-r--r-- | deployment/setup-dependency.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/deployment/setup-dependency.sh b/deployment/setup-dependency.sh new file mode 100644 index 0000000..fcb2d51 --- /dev/null +++ b/deployment/setup-dependency.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +function install_go { + local golang_version=go1.10.linux-amd64 + if [ ! -d /opt/go ]; then + mkdir /opt/go + pushd /opt/go + curl -O https://dl.google.com/go/$golang_version.tar.gz + tar -zxf $golang_version.tar.gz + echo GOROOT=$PWD/go >> /etc/environment + echo PATH=$PATH:$PWD/go/bin >> /etc/environment + rm -rf tar -zxf $golang_version.tar.gz + popd + fi + source /etc/environment +} + +function install_dependencies { + pushd src/dkv/ + make all + popd +} + +function create_mountpath { + cp -r mountpath/ /configs +} + +install_go +install_dependencies +create_mountpath |