mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 06:45:50 +00:00
Update maven-build.yml
This commit is contained in:
parent
6e297619ba
commit
8fc4b7e2de
1 changed files with 5 additions and 5 deletions
8
.github/workflows/maven-build.yml
vendored
8
.github/workflows/maven-build.yml
vendored
|
@ -79,11 +79,11 @@ jobs:
|
||||||
- name: Verify JAR file
|
- name: Verify JAR file
|
||||||
run: |
|
run: |
|
||||||
echo "Verifying JAR file presence..."
|
echo "Verifying JAR file presence..."
|
||||||
# List the files in the target directory
|
# Dynamically determine the JAR file path
|
||||||
ls -al /home/aiman/Documents/CI-CD/spring-petclinic/actions-runner/_work/spring-petclinic/spring-petclinic/target/
|
JAR_PATH="${{ github.workspace }}/target/spring-petclinic-3.3.0-SNAPSHOT.jar"
|
||||||
|
echo "Expected JAR Path: $JAR_PATH"
|
||||||
|
|
||||||
# Check if the JAR file exists and display a message if not
|
# Check if the JAR file exists and display a message if not
|
||||||
JAR_PATH="/home/aiman/Documents/CI-CD/spring-petclinic/target/spring-petclinic-3.3.0-SNAPSHOT.jar"
|
|
||||||
if [ ! -f "$JAR_PATH" ]; then
|
if [ ! -f "$JAR_PATH" ]; then
|
||||||
echo "JAR file not found at $JAR_PATH"
|
echo "JAR file not found at $JAR_PATH"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -107,7 +107,7 @@ jobs:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying application to $DEPLOY_SERVER"
|
echo "Deploying application to $DEPLOY_SERVER"
|
||||||
scp -i ~/.ssh/id_rsa /home/aiman/Documents/CI-CD/spring-petclinic/actions-runner/_work/spring-petclinic/spring-petclinic/target/spring-petclinic-3.3.0-SNAPSHOT.jar $DEPLOY_USER@$DEPLOY_SERVER:/home/aiman/deployments/
|
scp -i ~/.ssh/id_rsa $JAR_PATH $DEPLOY_USER@$DEPLOY_SERVER:/home/aiman/deployments/
|
||||||
ssh -i ~/.ssh/id_rsa $DEPLOY_USER@$DEPLOY_SERVER "nohup java -jar /home/aiman/deployments/spring-petclinic-3.3.0-SNAPSHOT.jar > /dev/null 2>&1 &"
|
ssh -i ~/.ssh/id_rsa $DEPLOY_USER@$DEPLOY_SERVER "nohup java -jar /home/aiman/deployments/spring-petclinic-3.3.0-SNAPSHOT.jar > /dev/null 2>&1 &"
|
||||||
rm -f ~/.ssh/id_rsa
|
rm -f ~/.ssh/id_rsa
|
||||||
- name: Wait for application to start
|
- name: Wait for application to start
|
||||||
|
|
Loading…
Reference in a new issue