Skip to content
Snippets Groups Projects
Commit 24cb04a9 authored by Burhan Akbar's avatar Burhan Akbar
Browse files

fixed docker location for jar

parent 3d90e827
Branches
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ pipeline {
environment {
// The App VM's connection string (user@IP)
APP_VM = "debian@10.72.100.16"
// Credential ID for SSH access to your App VM
// Credential ID for SSH access to App VM
SSH_CRED_ID = "appvm-ssh-cred"
}
......@@ -40,6 +40,7 @@ pipeline {
sh 'chmod +x gradlew'
// Skip tests during build
sh './gradlew --no-daemon clean assemble'
sh "sha256sum build/libs/HealthCare-0.0.1-SNAPSHOT.jar"
}
}
......@@ -75,6 +76,8 @@ pipeline {
sshagent([env.SSH_CRED_ID]) {
sh """
scp build/libs/HealthCare-0.0.1-SNAPSHOT.jar ${APP_VM}:~/healthcare/
"""
sh """
scp docker-compose.yml ${APP_VM}:~/healthcare/
scp Dockerfile ${APP_VM}:~/healthcare/
"""
......@@ -82,10 +85,10 @@ pipeline {
sh """
ssh ${APP_VM} '
cd ~/healthcare &&
/usr/bin/docker-compose down --remove-orphans || echo "Compose down failed or had nothing to do."
/usr/local/bin/docker-compose down --remove-orphans || echo "Compose down failed or had nothing to do."
docker system prune -f || echo "Prune failed."
docker rmi healthcare_healthcare_01 || echo "Image removal failed or image not found."
/usr/bin/docker-compose -f docker-compose.yml up -d --build || echo "Compose up command failed."
// docker rmi healthcare_healthcare_01 || echo "Image removal failed or image not found."
/usr/local/bin/docker-compose -f docker-compose.yml up -d --build || echo "Compose up command failed."
'
"""
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment