Skip to content

fix: 톰캣 커넥션 수 조절 #81

fix: 톰캣 커넥션 수 조절

fix: 톰캣 커넥션 수 조절 #81

Workflow file for this run

name: deploy
on:
push:
branches:
- main
- hot-fix
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up jdk 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Create application-secret.yml
run: |
echo "${{ secrets.SECRET }}" > ./src/main/resources/application-secret.yml
- name: Build with Gradle
run: |
ls -l
which chmod
/usr/bin/chmod +x ./gradlew
./gradlew clean build -x test
- name: transfer jar to ec2
env:
PRIVATE_KEY: ${{ secrets.KEY }}
HOST: ${{ secrets.HOST }}
USER: ${{ secrets.USER }}
run: |
echo "${PRIVATE_KEY}" > private_key && /usr/bin/chmod 600 private_key
scp -o StrictHostKeyChecking=no -i private_key ./build/libs/*.jar ${USER}@${HOST}:/home/ubuntu
- name: execute jar
env:
PRIVATE_KEY: ${{ secrets.KEY }}
HOST: ${{ secrets.HOST }}
USER: ${{ secrets.USER }}
run: |
/usr/bin/ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF
cd /home/ubuntu
PID=\$(lsof -t -i:8080)
if [ ! -z "\$PID" ]; then
echo "Killing process on port 8080"
sudo kill -9 \$PID || echo "Failed to kill process"
else
echo "No process found on port 8080"
fi
nohup java -XX:+HeapDumpOnOutOfMemoryError -jar storage-0.0.1-SNAPSHOT.jar --spring.profiles.active=local > app.log 2>&1 &
EOF