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

Rename Jenkinsfile.groovy to Jenkinsfile

parent 4d9c8a97
No related branches found
No related tags found
No related merge requests found
pipeline {
agent {
label 'your-agent-label' // Replace with your agent's label
}
stages {
stage('Checkout') {
steps {
git credentialsId: 'your-repo-credentials', url: 'your-repo-url'
}
}
stage('Build') {
steps {
sh './gradlew clean build'
}
}
stage('Test') {
steps {
sh './gradlew test'
}
}
stage('Database Migration') {
steps {
sh './migrate_db.sh'
}
}
stage('Deploy') {
steps {
sh 'pkill -f \'java -jar\''
sh 'nohup java -jar build/libs/HealthCare-0.0.1-SNAPSHOT.jar --server.port=8081 > app.log 2>&1 &'
}
}
}
post {
always {
echo "Pipeline finished"
}
success {
echo "Pipeline succeeded"
}
failure {
echo "Pipeline failed"
mail to: 'your-email@example.com',
subject: "Jenkins Pipeline Failed",
body: "The pipeline ${env.JOB_NAME} build ${env.BUILD_NUMBER} failed."
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment