diff --git a/Jenkinsfile b/Jenkinsfile index 2c0b4c87..e5411f18 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,32 +1,50 @@ pipeline { agent any - stages { + stages { stage ('Compile Stage') { - + when { + branch 'master' + } + steps { + sh ''' + echo "Hello master branch" + echo ${BRANCH_NAME} + echo ${BUILD_ID} + ''' + } + } + stage ('Testing Purpose') { steps { - withMaven(maven : 'maven_3_5_0') { - sh 'mvn clean compile' - } + sh ''' + echo "Second stage execution" + ''' } } stage ('Testing Stage') { + when { + branch 'develop' + } steps { - withMaven(maven : 'maven_3_5_0') { - sh 'mvn test' - } + sh ''' + echo "Hello develop branch" + ''' } } stage ('Deployment Stage') { + when { + branch 'feature-1' + } + steps { - withMaven(maven : 'maven_3_5_0') { - sh 'mvn deploy' - } + sh ''' + echo "Hello feature-1 branch" + ''' } } } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 5570d746..ed61144e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Fizz Buzz Example in Java 8 using JUnit 5 -### Fizz Buzz is a game where +### Fizz Buzz is a game where yes yes yes yes - if the number is divisible by 3, you say Fizz -- if the number is divisible by 5, you say Buzz -- if neither, you say the number \ No newline at end of file +- if the number is divisible by 5, you ssay Buzz +- if neither, you say the number