Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accept #28

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM maven:3.8.2-openjdk-8 as mavenbuild
ARG TEST=/var/lib/
WORKDIR ${TEST}
COPY . .
RUN mvn clean package

FROM tomcat:jre8-temurin-focal
ARG TEST=/var/lib
COPY --from=mavenbuild ${TEST}/target/hello-world-war-1.0.0.war /usr/local/tomcat/webapps
34 changes: 34 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
pipeline{
agent { label 'javanode1' }
stages{
stage('check out'){
steps{
sh "rm -rf hello-world-war"
sh "git clone https://github.com/arunhs07/hello-world-war.git"
}
}
stage('build'){
steps{
sh "pwd"
sh "ls"
sh "cd hello-world-war"
sh "docker build -t arunhs07/arunnewfile:1.0 ."
}
}
stage('publish'){
steps{
sh "docker login -u arunhs07 -p 9845682619@Aru"
sh "docker push arunhs07/arunnewfile:1.0"
}
}
stage('deploy'){
agent { label 'javanode2' }
steps{
sh "docker login -u arunhs07 -p 9845682619@Aru"
sh "docker pull arunhs07/arunnewfile:1.0"
sh "docker rm -f trail1"
sh "docker run -d -p 8085:8080 --name trail1 arunhs07/arunnewfile:1.0"
}
}
}
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ Hello World! (WAR-style)
===============

This is the simplest possible Java webapp for testing servlet container deployments. It should work on any container and requires no other dependencies or configuration.
hi hello
good morning
hello sharath gm
6 changes: 3 additions & 3 deletions src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<html>
<head>
<title>Hello World!</title>
<title>Hello Arun Hagedar's World!</title>
</head>
<body>
<h1>Hello World!</h1>
<h1>Hello Arun Hagedar's World!</h1>
<p>
It is now
<%= new java.util.Date() %></p>
<p>
You are coming from
<%= request.getRemoteAddr() %></p>
</body>
</body>