Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Add process IDs to .pidfile in start.sh and handle file existence in …
Browse files Browse the repository at this point in the history
…stop.sh
  • Loading branch information
nmcc1212 committed Apr 4, 2024
1 parent de2f493 commit ec1031e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Jenkins/start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
cd next/news-aggregation
npm run dev &
sleep 1
echo $! >> .pidfile
pid_web=$!
cd ../..

cd newAPI/src
ts-node index.ts &
sleep 1
echo $! >> .pidfile
pid_api=$!

echo $pid_web > .pidfile
echo $pid_api >> .pidfile

3 changes: 2 additions & 1 deletion Jenkins/stop.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kill $(cat .pidfile)
if [ -f .pidfile ]; then
kill $(cat .pidfile)

0 comments on commit ec1031e

Please sign in to comment.