feat(CI/CD) add scripts

This commit is contained in:
lumither committed 2024-06-18 14:25:36 +08:00
1 parent 6b75c17b05
commit 59f23e8672
5 files changed
+39 -1

No files matched your search

+9 -1
View File
@@ -12,13 +12,21 @@ if [ -z "$GIT_WORK_DIR" ]; then
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"
echo "Repo has updated; calling db update"
curl --request POST -sL \
--url "localhost:$BACKEND_PORT"
#todo: to be continued
fi
}