mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(global) container and project structure update
This commit is contained in:
11 files changed
+29
-37
No files matched your search
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# refresh env
|
||||
/bin/bash ./flush_env.sh
|
||||
|
||||
# start frontend
|
||||
cd frontend || exit
|
||||
screen -S nocturne_frontend -d -m bun dev
|
||||
cd ..
|
||||
|
||||
# start backend
|
||||
cd backend || exit
|
||||
screen -S nocturne_backend -d -m cargo r
|
||||
cd ..
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/env bash
|
||||
|
||||
cp .env ./backend
|
||||
cp .env ./frontend
|
||||
cp .env.local ./backend
|
||||
cp .env.local ./frontend
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
source .env
|
||||
|
||||
if [ -z "$BLOG_ENDPOINT" ]; then
|
||||
echo "BLOG_ENDPOINT is not set in the .env file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$GIT_WORK_DIR" ]; then
|
||||
echo "GIT_WORK_DIR is not set in the .env file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$BACKEND_PORT" ]; then
|
||||
echo "BACKEND_PORT is not set in the .env file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_for_updates() {
|
||||
cd "$GIT_WORK_DIR" || exit
|
||||
res=$(git pull)
|
||||
if echo "$res" | grep -q "Already up to date"; then
|
||||
echo "Repo is up to date."
|
||||
else
|
||||
echo "Repo has updated; calling db update"
|
||||
curl --request POST -sL \
|
||||
--url "localhost:$BACKEND_PORT"
|
||||
#todo: to be continued
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -d "$GIT_WORK_DIR" ]; then
|
||||
check_for_updates
|
||||
else
|
||||
git clone "$BLOG_ENDPOINT" "$GIT_WORK_DIR"
|
||||
if [ $? -eq 0 ]; then
|
||||
check_for_updates
|
||||
else
|
||||
echo "Failed to clone the repo"
|
||||
fi
|
||||
fi
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
. "$DIR/.env"
|
||||
|
||||
sudo groupadd nocturne
|
||||
USERNAME="$(whoami)"
|
||||
echo "$USERNAME"
|
||||
sudo usermod -aG nocturne "$USERNAME"
|
||||
|
||||
sudo mkdir -p "$LOG_ROOT_DIR/backend" "$LOG_ROOT_DIR/frontend"
|
||||
sudo chown -R :nocturne "$LOG_ROOT_DIR"
|
||||
sudo chmod -R 775 "$LOG_ROOT_DIR"
|
||||
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# refresh env
|
||||
/bin/bash ./flush_env.sh
|
||||
|
||||
# start frontend
|
||||
(
|
||||
cd frontend || exit
|
||||
bun i
|
||||
bun next build
|
||||
screen -S nocturne_frontend -d -m bun start
|
||||
cd ..
|
||||
) &
|
||||
|
||||
# start backend
|
||||
(
|
||||
cd backend || exit
|
||||
screen -S nocturne_backend -d -m cargo r -r
|
||||
cd ..
|
||||
) & wait
|
||||
Reference in new issue
Block a user