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
69 changes: 69 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
pipeline {

agent {
node {
label 'BuildInNode'
}
}

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

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/githubkhchua/book-helloworld.git']]
])
}
}

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

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"
"""
}
}

}
}
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<title>Welcome to OpenShift</title>
</head>
<body>
<h1>Hello, OpenShift.</h1>
<h1>Hello, OpenShift. Build try... more...</h1>
</body>
</html>