diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..c85fddf --- /dev/null +++ b/Jenkinsfile @@ -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..' + } + + } +} \ No newline at end of file diff --git a/README.md b/README.md index 6ae4ea5..4ef5ebd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Sysfoo Application -A Devops Learning App +A DEVOPS Learning app useful for CI implementation ## About the Application diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..520568b --- /dev/null +++ b/changelog.txt @@ -0,0 +1,2 @@ +ch01 +ch02