24 lines
526 B
Bash
24 lines
526 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# A script for deploying the website
|
||
|
# Made by sugary :3
|
||
|
# Adapted by yukijoou
|
||
|
|
||
|
set -e
|
||
|
|
||
|
WEBSITE_NAME='blog.kemonomimi.gay'
|
||
|
WEBSITES_PATH='/var/www/blog'
|
||
|
|
||
|
[ -w $WEBSITES_PATH ] || (echo 'Don`t have write permission on website root, did you forget sudo?' && exit 1);
|
||
|
|
||
|
BACKUP_DIR=$(mktemp -d)
|
||
|
|
||
|
cp -rf "$WEBSITES_PATH" $BACKUP_DIR/$WEBSITE_NAME.bak
|
||
|
echo "Made backup at $BACKUP_DIR"
|
||
|
|
||
|
rm -rf "$WEBSITES_PATH"
|
||
|
mkdir -p "$WEBSITES_PATH"
|
||
|
cp -rf public/* "$WEBSITES_PATH"
|
||
|
|
||
|
echo "Installed $WEBSITE_NAME at $WEBSITES_PATH"
|