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
42 changes: 42 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
pipeline {
agent any
stages {
stage('build') {
steps {
echo 'Compiling sysfoo app...'
sh 'mvn compile'
}
}

stage('test') {
steps {
echo 'running unit test'
sh 'mvn clean test'
}
}

stage('package') {
steps {
echo 'step 3'
sh '''# Truncate Git commit to first 7 characters
GIT_SHORT_COMMIT=$(echo $GIT_COMMIT | cut -c 1-7)

# Set Maven version using the short commit
mvn versions:set -DnewVersion="$GIT_SHORT_COMMIT"
mvn versions:commit'''
sh 'mvn package -DskipTests'
archiveArtifacts '**/target/*.jar'
}
}

}
tools {
maven 'Maven 3.9.11'
}
post {
always {
echo 'This pipeline is completed..'
}

}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Sysfoo Application

A Devops Learning App
A DEVOPS Learning app useful for CI implementation

## About the Application

Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ch01
ch02