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
1 change: 1 addition & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change Log
59 changes: 59 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
pipeline {
agent none
stages {
stage('build') {
agent {
docker {
image 'maven:3.9.6-eclipse-temurin-17-alpine'
}

}
steps {
echo 'compiling sysfoo app...'
sh 'mvn compile'
}
}

stage('test') {
agent {
docker {
image 'maven:3.9.6-eclipse-temurin-17-alpine'
}

}
steps {
echo 'running unit tests...'
sh 'mvn clean test'
}
}

stage('package') {
agent {
docker {
image 'maven:3.9.6-eclipse-temurin-17-alpine'
}

}
steps {
echo 'packaging the app...'
sh 'mvn package -DskipTests'
archiveArtifacts '**/target/*.jar'
sh '''# Truncate the GIT_COMMIT to the first 7 characters
GIT_SHORT_COMMIT=$(echo $GIT_COMMIT | cut -c 1-7)
# Set the version using Maven
mvn versions:set -DnewVersion="$GIT_SHORT_COMMIT"
mvn versions:commit'''
}
}

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

}
}