test ci#3

feature/reliability_stat
Cizz22 1 year ago
parent 002f81bbb4
commit 9f0de3a97b

27
Jenkinsfile vendored

@ -8,8 +8,15 @@ pipeline {
DOCKER_CREDENTIALS = credentials('aimodocker')
// Replace with your image name
IMAGE_NAME = 'oh-service'
// Replace with your docker compose service name
SERVICE_NAME = 'oh-app'
// Variable for Git commit hash
GIT_COMMIT_HASH = ''
// Replace with the SSH credentials for development server
// SSH_CREDENTIALS = credentials('backend-server-digitaltwin')
// SSH_CREDENTIALS_USR = 'aimo'
// SSH_SERVER_IP = '192.168.1.82'
}
stages {
@ -54,6 +61,22 @@ pipeline {
"""
}
}
// stage('Deploy') {
// steps {
// script {
// sshagent(credentials: [SSH_CREDENTIALS]) {
// sh """
// ssh -o StrictHostKeyChecking=no ${SSH_CREDENTIALS_USR}@${SSH_SERVER_IP} '
// cd ~/digital-twin/Docker
// sudo docker compose pull ${SERVICE_NAME}
// sudo docker compose up -d ${SERVICE_NAME}
// '
// """
// }
// }
// }
// }
}
post {
@ -75,10 +98,10 @@ pipeline {
}
}
success {
echo "Successfully built and pushed Docker image with tags: latest and ${GIT_COMMIT_HASH}"
echo "Successfully built, pushed, and deployed Docker image with tags: latest and ${GIT_COMMIT_HASH}"
}
failure {
echo 'Failed to build/push Docker image!'
echo 'Failed to build/push/deploy Docker image!'
}
}
}
Loading…
Cancel
Save