diff --git a/Changelog.txt b/Changelog.txt new file mode 100644 index 0000000..37dcc3d --- /dev/null +++ b/Changelog.txt @@ -0,0 +1 @@ +Change Log diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..4ea9d0f --- /dev/null +++ b/Jenkinsfile @@ -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..' + } + + } +} \ No newline at end of file