mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(CI/CD) add scripts
This commit is contained in:
5 files changed
+39
-1
No files matched your search
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# refresh env
|
||||||
|
/bin/bash ./flush_env.sh
|
||||||
|
|
||||||
|
# start frontend
|
||||||
|
cd frontend;
|
||||||
|
screen -S blog_frontend -d -m bun dev;
|
||||||
|
cd ..;
|
||||||
|
|
||||||
|
# start backend
|
||||||
|
cd backend;
|
||||||
|
screen -S blog_backend -d -m cargo r;
|
||||||
|
cd ..;
|
||||||
Regular → Executable
File mode changed.
@@ -0,0 +1 @@
|
|||||||
|
ngx.say("hello world")
|
||||||
+9
-1
@@ -12,13 +12,21 @@ if [ -z "$GIT_WORK_DIR" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$BACKEND_PORT" ]; then
|
||||||
|
echo "BACKEND_PORT is not set in the .env file"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
check_for_updates() {
|
check_for_updates() {
|
||||||
cd "$GIT_WORK_DIR" || exit
|
cd "$GIT_WORK_DIR" || exit
|
||||||
res=$(git pull)
|
res=$(git pull)
|
||||||
if echo "$res" | grep -q "Already up to date"; then
|
if echo "$res" | grep -q "Already up to date"; then
|
||||||
echo "Repo is up to date."
|
echo "Repo is up to date."
|
||||||
else
|
else
|
||||||
echo "Repo has updated"
|
echo "Repo has updated; calling db update"
|
||||||
|
curl --request POST -sL \
|
||||||
|
--url "localhost:$BACKEND_PORT"
|
||||||
|
#todo: to be continued
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# refresh env
|
||||||
|
/bin/bash ./flush_env.sh
|
||||||
|
|
||||||
|
# start frontend
|
||||||
|
cd frontend;
|
||||||
|
bun next build
|
||||||
|
screen -S blog_frontend -d -m bun start;
|
||||||
|
cd ..;
|
||||||
|
|
||||||
|
# start backend
|
||||||
|
cd backend;
|
||||||
|
screen -S blog_backend -d -m cargo r -r;
|
||||||
|
cd ..;
|
||||||
Reference in new issue
Block a user