Skip to content
Open
Show file tree
Hide file tree
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
70 changes: 8 additions & 62 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,69 +1,15 @@
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"
"""
}
}

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

stage(' Unit Testing') {
stage('Print Value') {
steps {
sh """
echo "Running Unit Tests"
"""
script {
def myValue = "Hello, Jenkins!"
echo "My value is in develop-test branch: ${myValue}"
}
}
}

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

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

sh """
echo "Deploying Code"
"""
}
}

}
// Add more stages as needed
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# multibranch-pipeline-demo
Jenkins Multibranch Pipeline Example Repo
Jenkins Multibranch Pipeline Example Repo 1