-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8313b8b
commit b1c712d
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!' | ||
} | ||
} | ||
} |