diff --git a/Jenkinsfile b/Jenkinsfile index 5ebf9def9..51ce19a61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,60 +1,38 @@ - pipeline{ - tools{ - jdk 'myjava' - maven 'mymaven' - } - agent any - stages{ - stage('Checkout'){ - - steps{ - echo 'cloning..' - git 'https://github.com/Sonal0409/DevOpsClassCodes.git' - } - } - stage('Compile'){ - - steps{ - echo 'compiling..' - sh 'mvn compile' - } - } - stage('CodeReview'){ - - steps{ - - echo 'codeReview' - sh 'mvn pmd:pmd' - } - } - stage('UnitTest'){ - - steps{ - echo 'Testing' - sh 'mvn test' - } - post { - success { - junit 'target/surefire-reports/*.xml' - } - } - } - stage('MetricCheck'){ - - steps{ - sh 'mvn cobertura:cobertura -Dcobertura.report.format=xml' - } - - } - stage('Package'){ - - steps{ - - sh 'mvn package' - } - } - - - } + tools{ + maven 'Maven394' +} + agent{ + label 'Agent' +} + stages{ + + stage('fetch code'){ + steps{ + git 'https://github.com/Sonal0409/DevOpsClassCodes.git' + +} +} + stage('clean'){ + steps{ + sh 'mvn clean' +} +} + stage('compile'){ + steps{ + sh 'mvn compile' +} +} + + stage('test'){ + steps{ + sh 'mvn test' +} +} + stage('package'){ + steps{ + sh 'mvn package' +} +} +} } diff --git a/dockerfile b/dockerfile new file mode 100644 index 000000000..19a6f3834 --- /dev/null +++ b/dockerfile @@ -0,0 +1,4 @@ +FROM tomcat:9 +ADD addressbook.war /usr/local/tomcat/webapps/ +EXPOSE 8080 +CMD ["catalina.sh", "run"]