Go and Ergo Deployment Scripts
Signed-off-by: Georg Pfuetzenreuter <georg@lysergic.dev>
This commit is contained in:
parent
6f12a0bf5b
commit
b3f17a4721
27
scripts/sh/deploy_ergo.sh
Executable file
27
scripts/sh/deploy_ergo.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
GOVER=`go version | { read _ _ v _; echo ${v#go}; }`
|
||||
echo "Detected Go $GOVER"
|
||||
GOVER_REQ="1.16.0"
|
||||
if [ "$(printf '%s\n' "$GOVER_REQ" "$GOVER" | sort -V | head -n1)" = "$GOVER_REQ" ]
|
||||
then
|
||||
read -p "Deploy Ergo on this system? " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
zypper in --no-recommends -y git make
|
||||
REPO="https://github.com/ergochat/ergo.git"
|
||||
mkdir /opt/ergo
|
||||
useradd -rUd /opt/ergo -s /bin/false ergo
|
||||
chown ergo:ergo /opt/ergo
|
||||
chmod 750 /opt/ergo
|
||||
usermod -aG ergo pratyush
|
||||
usermod -aG ergo georg
|
||||
sudo -u ergo git clone $REPO /opt/ergo/ergo-git
|
||||
cd /opt/ergo/ergo-git
|
||||
sudo -u ergo make build
|
||||
sudo -u ergo chmod +x ergo
|
||||
ln -s /opt/ergo/ergo-git/ergo /opt/ergo/ergo
|
||||
fi
|
||||
else
|
||||
echo "This is currently only compatible with Go 1.16.6 or higher. Consider deploy_go.sh."
|
||||
fi
|
22
scripts/sh/deploy_go.sh
Executable file
22
scripts/sh/deploy_go.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
DISTRIB=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
|
||||
echo $DISTRIB
|
||||
if [[ ${DISTRIB} = "openSUSE Leap" ]]
|
||||
echo
|
||||
then
|
||||
read -p "Deploy Go on this system? " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
if [ ! -f /etc/zypp/repos.d/go.repo ]
|
||||
then
|
||||
REPO="https://download.opensuse.org/repositories/devel:/languages:/go/openSUSE_Leap_15.3/devel:languages:go.repo"
|
||||
zypper ar --gpgcheck-allow-unsigned-repo $REPO
|
||||
fi
|
||||
zypper ref
|
||||
zypper in -y go
|
||||
echo OK
|
||||
fi
|
||||
else
|
||||
echo "This is currently only compatible with SUSE Leap nodes."
|
||||
fi
|
Loading…
Reference in New Issue
Block a user