Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 8 additions & 42 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,69 +1,35 @@
pipeline {

agent {
node {
label 'master'
}
}

options {
buildDiscarder logRotator(
daysToKeepStr: '16',
numToKeepStr: '10'
)
}
agent any

stages {

stage('Cleanup Workspace') {
steps {
cleanWs()
sh """
echo "Cleaned Up Workspace For Project"
"""
echo "Cleaning up workspace..."
}
}

stage('Code Checkout') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: '*/main']],
userRemoteConfigs: [[url: 'https://github.com/spring-projects/spring-petclinic.git']]
])
echo "Checking out code from the repository..."
}
}

stage(' Unit Testing') {
stage('Unit Testing') {
steps {
sh """
echo "Running Unit Tests"
"""
echo "Running unit tests..."
}
}

stage('Code Analysis') {
steps {
sh """
echo "Running Code Analysis"
"""
echo "Running code analysis..."
}
}

stage('Build Deploy Code') {
when {
branch 'develop'
}
steps {
sh """
echo "Building Artifact"
"""

sh """
echo "Deploying Code"
"""
echo "Building and deploying code..."
}
}

}
}
}