diff --git a/Dockerfile b/Dockerfile index 31f3ab15..797565a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # Pull base image -From tomcat:8-jre8 - +FROM tomcat:8 +LABEL app=my-app # Maintainer -MAINTAINER "sai4cs@gmail.com" -COPY ./webapp.war /usr/local/tomcat/webapps -RUN cp -R /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps \ No newline at end of file +MAINTAINER "lharish609@gmail.com" +COPY target/webapp.war /usr/local/tomcat/webapps/myweb.war diff --git a/Jenkins b/Jenkins new file mode 100644 index 00000000..e25224be --- /dev/null +++ b/Jenkins @@ -0,0 +1,29 @@ +pipeline +{ + agent any + stages + { + stage('testing code') + { + steps + { + sh 'echo "testing application"' + } + } + stage('deploying code') + { + steps + { + sh 'echo "deploying application"' + } + } + stage('deliver code') + { + steps + { + sh 'echo "deliver application"' + } + } + } + +} diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..2ac5bf91 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,54 @@ +pipeline { + agent any + stages { + stage('checkout scm') { + parallel { + stage('checkout scm') { + steps { + git(url: 'https://github.com/lhari505/SaiJavaCode.git', branch: 'master') + } + } + + stage('chech pom.xml') { + steps { + echo 'pom.xml' + } + } + + } + } + + stage('build') { + parallel { + stage('build') { + steps { + sh 'mvn clean package' + } + } + + stage('build dev') { + steps { + echo 'building dev' + } + } + + } + } + + stage('test') { + steps { + sh 'mvn test' + } + } + + stage('deploy') { + steps { + sh 'docker build -t harishl/my-app:1.0.0 .' + } + } + + } + tools { + maven 'M2_HOME' + } +} \ No newline at end of file