Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# build stage——
FROM maven:3.8.6-openjdk-8 AS builder
WORKDIR /app
COPY . /app
RUN mvn clean install

# final image
FROM tomcat:9.0
RUN apt-get update && apt-get install vim -y
COPY --from=builder /app/target/ekart.war /usr/local/tomcat/webapp
ENTRYPOINT /usr/local/tomcat/bin/startup.sh && bash
37 changes: 8 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,23 @@
pipeline {
agent any

triggers {
cron('H/2 * * * 1-5')
}
tools {
maven 'Maven3'
jdk 'java8'

}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage ('Initialize') {
stage('Checkout') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
'''
checkout scm
}
}

stage ('Build') {
stage('Build') {
steps {
sh 'mvn -Dmaven.test.failure.ignore=true install'
}
post {
success {
junit 'target/surefire-reports/**/*.xml'
}
}
}

stage ('Deploy'){
steps{
sh 'echo "deploying into qa server"'
sh '''
docker build -f Dockerfile -t ekart .
'''
}

}
}

}