forked from cohabit/server_config
29 lines
705 B
Bash
29 lines
705 B
Bash
# Check if already installed
|
|
if [[ $(which deno) == "/usr/local/bin/deno" ]]; then
|
|
# Upgrade deno
|
|
deno upgrade
|
|
else
|
|
# Install deno
|
|
curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh
|
|
|
|
# Create group and user
|
|
groupadd --system deno
|
|
|
|
useradd --system \
|
|
--gid deno \
|
|
--create-home \
|
|
--home-dir /var/lib/deno \
|
|
--shell /usr/sbin/nologin \
|
|
--comment "Deno js engine" \
|
|
deno
|
|
fi
|
|
|
|
# Remove old files if exists
|
|
rm -rf /srv/portfolio
|
|
# Create fs tree is missing
|
|
mkdir -p /srv/portfolio
|
|
# Set directory owner
|
|
chown -R deno:deno /srv/portfolio
|
|
# Clone website repo
|
|
git clone -b main --depth 1 https://git.cohabit.fr/cohabit/portfolio_server.git /srv/portfolio
|