Skip to content

Commit

Permalink
Create jenkins file
Browse files Browse the repository at this point in the history
  • Loading branch information
DanishCh4321 authored Jun 30, 2024
1 parent 8313b8b commit b1c712d
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions jenkins file
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
pipeline {
agent any

environment {
// Define any environment variables here
PROJECT_NAME = "E-commerce-project-springBoot"
GITHUB_REPO_URL = "https://github.com/jaygajera17/E-commerce-project-springBoot.git"
}

stages {
stage('Checkout') {
steps {
// Checkout the code from the GitHub repository
git url: "${GITHUB_REPO_URL}", branch: 'main'
}
}

stage('Build') {
steps {
// Build the project using Maven
sh 'mvn clean package'
}
}

stage('Test') {
steps {
// Run the tests
sh 'mvn test'
}
}

stage('Deploy') {
steps {
// Deploy the application (this can be customized as per your deployment process)
// For example, copying the built JAR file to a specific location, or deploying to a cloud service
sh '''
echo "Deploying application..."
# Example command: copying the built JAR file to a remote server
# scp target/*.jar user@remote-server:/path/to/deployment/directory
'''
}
}
}

post {
always {
// Actions to perform at the end of the pipeline
// For example, cleaning up workspace, sending notifications, etc.
cleanWs()
}
success {
// Actions to perform if the pipeline succeeds
echo 'Pipeline succeeded!'
}
failure {
// Actions to perform if the pipeline fails
echo 'Pipeline failed!'
}
}
}

0 comments on commit b1c712d

Please sign in to comment.