-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfast_build_fastocloud_env_for_dev.sh
More file actions
executable file
·57 lines (51 loc) · 1.28 KB
/
fast_build_fastocloud_env_for_dev.sh
File metadata and controls
executable file
·57 lines (51 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -ex
# exports
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export DEBIAN_FRONTEND=noninteractive
export PATH=$PATH:$HOME/.cargo/bin
# variables
USER=fastocloud
# update system
if [[ "$OSTYPE" == "linux-gnu" ]]; then
if [ -n "$(command -v yum)" ]; then
yum update -y
yum install -y git ca-certificates python3-setuptools python3-pip rpm
elif [ -n "$(command -v apt-get)" ]; then
apt-get update
apt-get install -y ca-certificates git python3-setuptools python3-pip rpm --no-install-recommends
else
:
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
:
elif [[ "$OSTYPE" == "cygwin" ]]; then
:
elif [[ "$OSTYPE" == "msys" ]]; then
pacman -Suy
pacman -S --need --noconfirm ca-certificates git python3-setuptools python3-pip
:
elif [[ "$OSTYPE" == "win32" ]]; then
:
elif [[ "$OSTYPE" == "freebsd"* ]]; then
:
else
:
fi
# install pyfastogt
if [ -d "pyfastogt" ]; then
echo "Removing existing pyfastogt directory..."
rm -rf pyfastogt
fi
git clone https://gitlab.com/fastogt/pyfastogt
cd pyfastogt
pip3 install --break-system-packages .
cd ../
rm -rf pyfastogt
# build env for service
./build_env.py "$@"
# add user
if ! id "$USER" &>/dev/null; then
useradd -m -U -d /home/$USER $USER -s /bin/bash
fi
usermod -a -G video $USER