feat: prevent reinstall and upragde if available
This commit is contained in:
parent
1215d25186
commit
cf1191bdc3
|
@ -1,9 +1,12 @@
|
||||||
# Install prerequistes
|
# Check if already installed
|
||||||
nala install -y debian-keyring debian-archive-keyring apt-transport-https curl
|
if [[ $(which caddy) != "/usr/bin/caddy" ]]; then
|
||||||
|
# Install prerequistes
|
||||||
|
nala install -y debian-keyring debian-archive-keyring apt-transport-https curl
|
||||||
|
|
||||||
|
# Install sources and keys
|
||||||
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
||||||
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||||
|
fi
|
||||||
|
|
||||||
# Install sources and keys
|
# Install or upgrade caddy
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
|
||||||
|
|
||||||
# Install caddy
|
|
||||||
nala install -y caddy
|
nala install -y caddy
|
||||||
|
|
|
@ -1,28 +1,31 @@
|
||||||
# Get latest forgejo tag
|
# Get latest forgejo tag
|
||||||
LATEST=curl -fsS https://codeberg.org/forgejo/forgejo/releases/latest | grep -o "[0-9].[0-9].[0-9]"
|
LATEST=curl -fsS https://codeberg.org/forgejo/forgejo/releases/latest | grep -o "[0-9].[0-9].[0-9]" | head -1
|
||||||
|
|
||||||
# Download forgejo
|
# Check if already installed
|
||||||
wget "https://codeberg.org/forgejo/forgejo/releases/download/$LATEST/forgejo-$LATEST-linux-amd64"
|
if [[ $(forgejo -v 2> /dev/null | grep -o "[0-9].[0-9].[0-9]" | head -1) != $LATEST ]]; then
|
||||||
chmod +x "forgejo-$LATEST-linux-amd64"
|
# Download forgejo
|
||||||
|
wget "https://codeberg.org/forgejo/forgejo/releases/download/$LATEST/forgejo-$LATEST-linux-amd64"
|
||||||
# Check GPG Keys
|
chmod +x "forgejo-$LATEST-linux-amd64"
|
||||||
gpg --keyserver keys.openpgp.org --recv EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
|
|
||||||
wget "https://codeberg.org/forgejo/forgejo/releases/download/v$LATEST/forgejo-$LATEST-linux-amd64.asc"
|
# Check GPG Keys
|
||||||
gpg --verify "forgejo-$LATEST-linux-amd64.asc" "forgejo-$LATEST-linux-amd64"
|
gpg --keyserver keys.openpgp.org --recv EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
|
||||||
|
wget "https://codeberg.org/forgejo/forgejo/releases/download/v$LATEST/forgejo-$LATEST-linux-amd64.asc"
|
||||||
# Create group and user
|
gpg --verify "forgejo-$LATEST-linux-amd64.asc" "forgejo-$LATEST-linux-amd64"
|
||||||
groupadd --system forgejo
|
|
||||||
|
# Create group and user
|
||||||
useradd --system \
|
groupadd --system forgejo
|
||||||
--gid forgejo
|
|
||||||
--create-home \
|
useradd --system \
|
||||||
--home-dir /var/lib/forgejo \
|
--gid forgejo
|
||||||
--shell /usr/sbin/nologin \
|
--create-home \
|
||||||
--comment "Forgejo Git forge" \
|
--home-dir /var/lib/forgejo \
|
||||||
forgejo
|
--shell /usr/sbin/nologin \
|
||||||
|
--comment "Forgejo Git forge" \
|
||||||
# Setup forgejo directories
|
forgejo
|
||||||
mv "forgejo-$LATEST-linux-amd64" /usr/local/bin/forgejo
|
|
||||||
|
# Setup forgejo directories
|
||||||
|
mv "forgejo-$LATEST-linux-amd64" /usr/local/bin/forgejo
|
||||||
|
fi
|
||||||
|
|
||||||
## Working directory
|
## Working directory
|
||||||
mkdir /var/lib/forgejo
|
mkdir /var/lib/forgejo
|
||||||
|
|
|
@ -1,16 +1,22 @@
|
||||||
# Install deno
|
# Check if already installed
|
||||||
curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh
|
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
|
# Create group and user
|
||||||
groupadd --system deno
|
groupadd --system deno
|
||||||
|
|
||||||
useradd --system \
|
useradd --system \
|
||||||
--gid deno \
|
--gid deno \
|
||||||
--create-home \
|
--create-home \
|
||||||
--home-dir /var/lib/deno \
|
--home-dir /var/lib/deno \
|
||||||
--shell /usr/sbin/nologin \
|
--shell /usr/sbin/nologin \
|
||||||
--comment "Deno js engine" \
|
--comment "Deno js engine" \
|
||||||
deno
|
deno
|
||||||
|
fi
|
||||||
|
|
||||||
# Clone website repo
|
# Clone website repo
|
||||||
mkdir -p /srv/www
|
mkdir -p /srv/www
|
||||||
|
|
Loading…
Reference in a new issue