Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update auto-deployment.yml #23

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/auto-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ jobs:
scp -i private_key.pem $jarPath "${username}@${host}:~/server.jar"

- name: Startup new uploaded jar
run: ssh -i private_key.pem "${username}@${host}" "deploy/startup.sh"
run: ssh -i private_key.pem "${username}@${host}" "source ~/.profile; deploy/startup.sh"

- name: Wait 30 seconds for server to startup
run: sleep 30

- name: Check and Recover
run: ssh -i private_key.pem "${username}@${host}" "deploy/check_and_recover.sh"
run: ssh -i private_key.pem "${username}@${host}" "source ~/.profile; deploy/check_and_recover.sh"
5 changes: 2 additions & 3 deletions JWT/deploy/check_and_recover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ if [ -z "$pid" ]; then
sudo mv server.bak.jar server.jar
echo "backup jar recovered."

nohup java -jar server.jar --spring.profiles.active=dev 2>&1 > out.log &
echo "backup server no running on port 8080"
exit 0
"${script_dir}/startup.sh"
exit 1
fi

echo "recovory fail: no backup jar file found"
Expand Down
4 changes: 1 addition & 3 deletions JWT/deploy/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ if [ -n "$pid" ]; then
echo "Error: PID '${pid}' is conneted to port 8080. cannot startup new process."
exit 1
fi

nohup java -jar server.jar --spring.profiles.active=dev 2>&1 > out.log &
nohup java -jar server.jar --spring.profiles.active=dev > out.log 2>&1 & disown
echo "server started at port 8080."
echo "stdout & stderr directed to 'out.log'"