From b1f2ebaaa17e5ad40e3d8c378ad9680cfc0d013a Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Wed, 29 May 2024 14:03:17 +0200 Subject: [PATCH] feat: add `website` install and deploy scripts --- website/_deploy.sh | 11 +++++++++++ website/_install.sh | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 website/_deploy.sh create mode 100644 website/_install.sh diff --git a/website/_deploy.sh b/website/_deploy.sh new file mode 100644 index 0000000..1606998 --- /dev/null +++ b/website/_deploy.sh @@ -0,0 +1,11 @@ +# Pull website sources +cd /srv/www +git pull origin main + +# Setup website service +cp /srv/www/website.service /etc/systemd/system + +# Start website +systemctl deamon-reload +systemctl enable website +systemctl start website diff --git a/website/_install.sh b/website/_install.sh new file mode 100644 index 0000000..f291550 --- /dev/null +++ b/website/_install.sh @@ -0,0 +1,17 @@ +# 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 + +# Clone website repo +mkdir -p /srv/www +git clone https://git.cohabit.fr/cohabit/website.git /srv/www