Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
09aae83
Create Jenkinsfile
csenapati12 Jul 27, 2018
d955739
Rename Jenkinsfile to Dockerfile
csenapati12 Jul 27, 2018
6bb9e7a
Update Dockerfile
csenapati12 Jul 27, 2018
a490145
Update Dockerfile
csenapati12 Jul 27, 2018
1463aaf
Update Dockerfile
csenapati12 Aug 16, 2018
cbe2dac
Update Dockerfile
csenapati12 Oct 2, 2018
b8059ef
Create Jenkinsfile
csenapati12 Oct 3, 2018
1e77102
Update Jenkinsfile
csenapati12 Oct 3, 2018
ce86c7e
Merge pull request #1 from csenapati12/dev-with-dockerfile
csenapati12 Oct 15, 2018
0a40bdc
Update index.jsp
csenapati12 Jan 22, 2019
2ea635c
Update index.jsp
csenapati12 Jan 22, 2019
8fd5ee6
Update pom.xml
csenapati12 Jan 22, 2019
a0c6637
Update index.jsp
csenapati12 Feb 8, 2019
263bc19
Update pom.xml
csenapati12 Feb 23, 2019
444bedc
Update README.md
csenapati12 Mar 4, 2019
6a55f09
test commit on 4th feb
csenapati12 Mar 4, 2019
a9d5992
Update Dockerfile
csenapati12 Mar 20, 2019
dfc9942
Update Dockerfile
csenapati12 Mar 20, 2019
bde6106
Update Dockerfile
csenapati12 Mar 20, 2019
be5e91c
Update index.jsp
csenapati12 Mar 20, 2019
623fc3d
Update index.jsp
csenapati12 Mar 20, 2019
3a1ffa5
Update Dockerfile
csenapati12 Mar 28, 2019
f3e975f
Update index.jsp
csenapati12 Apr 2, 2019
e778d40
Update Jenkinsfile
csenapati12 May 2, 2019
f3aa56b
Update Jenkinsfile
csenapati12 May 6, 2019
79f6abd
Update Jenkinsfile
csenapati12 May 9, 2019
8a44512
Update Jenkinsfile
csenapati12 May 11, 2019
9b2ba9c
Update pom.xml
csenapati12 May 11, 2019
5001e22
Update pom.xml
csenapati12 Jun 14, 2019
4a22c5f
Update pom.xml
csenapati12 Jun 18, 2019
10518be
Update pom.xml
csenapati12 Jun 18, 2019
4e9c5c1
Update pom.xml
csenapati12 Jun 18, 2019
c363a86
Update pom.xml
csenapati12 Jul 2, 2019
63c142f
Update pom.xml
csenapati12 Jul 11, 2019
a4c8d60
Update pom.xml
csenapati12 Jul 12, 2019
be5815f
Update pom.xml
csenapati12 Jul 17, 2019
beb326a
Update pom.xml
csenapati12 Jul 17, 2019
8cbe699
Update pom.xml
csenapati12 Jul 17, 2019
a750ffe
Update pom.xml
csenapati12 Jul 19, 2019
cc56a07
Update index.jsp
csenapati12 Jul 19, 2019
7a4ba91
Update index.jsp
csenapati12 Jul 19, 2019
75a0a21
Update index.jsp
csenapati12 Jul 22, 2019
0b6c736
Update Jenkinsfile
csenapati12 Aug 5, 2019
70e11c3
Update Jenkinsfile
csenapati12 Aug 8, 2019
23ebd20
Create Jenkinsfile-new
csenapati12 Aug 8, 2019
0f1609d
Update index.jsp
csenapati12 Aug 11, 2019
7baa96b
Update pom.xml
csenapati12 Aug 12, 2019
255effc
Update index.jsp
csenapati12 Aug 28, 2019
f5c378e
Update index.jsp
csenapati12 Aug 28, 2019
a1a7de6
Update index.jsp
csenapati12 Sep 9, 2019
f3a378f
Update Dockerfile
csenapati12 Sep 9, 2019
f97fef4
adding devops session
teluharish Sep 10, 2019
ee31988
Merge pull request #4 from teluharis/master
csenapati12 Sep 10, 2019
42b4c30
Update index.jsp
csenapati12 Sep 11, 2019
9ffb41c
Update index.jsp
csenapati12 Sep 11, 2019
ff23086
Update index.jsp
csenapati12 Sep 11, 2019
39a4ec4
Update index.jsp
csenapati12 Sep 11, 2019
da9f42d
Update Jenkinsfile
csenapati12 Sep 12, 2019
18d0ba8
Update Jenkinsfile
csenapati12 Sep 12, 2019
0ab0762
Create Jenkinsfile-docker
csenapati12 Sep 12, 2019
8a05da2
Update Jenkinsfile-docker
csenapati12 Sep 12, 2019
d84c926
Update index.jsp
csenapati12 Sep 12, 2019
fef86b8
Update Jenkinsfile-docker
csenapati12 Sep 12, 2019
d5ff135
Update Jenkinsfile-docker
csenapati12 Sep 12, 2019
bf27d65
test pull SCM
csenapati12 Sep 19, 2019
272b0fe
Update Jenkinsfile
csenapati12 Sep 19, 2019
5d5830d
Update Jenkinsfile
csenapati12 Sep 19, 2019
8929500
Update Jenkinsfile
csenapati12 Sep 19, 2019
521902b
Update index.jsp
csenapati12 Oct 15, 2019
d08d251
Update index.jsp
csenapati12 Oct 15, 2019
1d4dd69
Update index.jsp
csenapati12 Oct 15, 2019
5048d92
Update index.jsp
csenapati12 Oct 15, 2019
0fd4668
Update index.jsp
csenapati12 Oct 15, 2019
ad825bb
Update index.jsp
csenapati12 Oct 15, 2019
69a79fc
Update pom.xml
csenapati12 Dec 23, 2019
66da6df
Update pom.xml
csenapati12 Dec 23, 2019
0bc4842
Update index.jsp
csenapati12 Jan 28, 2020
9c87375
Update pom.xml
csenapati12 Jan 28, 2020
adcd79d
Update pom.xml
csenapati12 Feb 10, 2020
a76173b
Update pom.xml
csenapati12 Feb 10, 2020
4b778db
Update Dockerfile
csenapati12 Feb 15, 2020
a1c29ba
Update Dockerfile
csenapati12 Feb 15, 2020
76a22c2
Update Dockerfile
csenapati12 Feb 15, 2020
ee801a5
Update Dockerfile
csenapati12 Feb 15, 2020
f09b570
Update Dockerfile
csenapati12 Feb 15, 2020
d3bb162
Update pom.xml
csenapati12 Feb 15, 2020
59eb181
Update index.jsp
csenapati12 Feb 15, 2020
210f73c
Update index.jsp
csenapati12 Feb 15, 2020
29e27ae
Update Jenkinsfile
csenapati12 Feb 19, 2020
887f299
Update Jenkinsfile
csenapati12 Feb 19, 2020
fc495bb
Update index.jsp
csenapati12 Feb 24, 2020
7337161
Update index.jsp
csenapati12 Feb 24, 2020
42373db
Update index.jsp
csenapati12 Feb 24, 2020
9772829
Update pom.xml
csenapati12 Feb 24, 2020
a60f41a
Update pom.xml
csenapati12 Feb 24, 2020
5d66c37
Update pom.xml
csenapati12 Feb 24, 2020
d63527d
Update pom.xml
csenapati12 Feb 24, 2020
9a4b4ae
Update pom.xml
csenapati12 Feb 24, 2020
1cc21b9
Update pom.xml
csenapati12 Feb 24, 2020
38fa8ae
Update pom.xml
csenapati12 Feb 25, 2020
36e898e
Update pom.xml
csenapati12 Feb 25, 2020
6266d03
Update pom.xml
csenapati12 Feb 25, 2020
4842b00
Update pom.xml
csenapati12 Feb 25, 2020
ca587ff
Update index.jsp
csenapati12 Mar 10, 2020
eb3cda5
Update index.jsp
csenapati12 Mar 14, 2020
ad556bd
Update pom.xml
csenapati12 Mar 20, 2020
d051623
Update Dockerfile
csenapati12 May 17, 2020
c66ec5a
Update index.jsp
csenapati12 May 19, 2020
21d2e35
Update pom.xml
csenapati12 May 19, 2020
4cd7cfb
Update index.jsp
csenapati12 May 19, 2020
075c61b
Update Dockerfile
csenapati12 Aug 12, 2020
ecbf322
Update index.jsp
csenapati12 Aug 12, 2020
a099597
Update index.jsp
csenapati12 Aug 13, 2020
3cebd9b
Update index.jsp
csenapati12 Aug 13, 2020
4c723cd
Update index.jsp
csenapati12 Aug 13, 2020
50c2dab
Update index.jsp
csenapati12 Aug 13, 2020
d09d0bd
Update index.jsp
csenapati12 Aug 13, 2020
be8b275
Update pom.xml
csenapati12 Aug 15, 2020
e9ba613
Update pom.xml
csenapati12 Aug 15, 2020
3682ee4
Update Dockerfile
csenapati12 Aug 15, 2020
9446032
Update index.jsp
csenapati12 Aug 15, 2020
62236bf
Update index.jsp
csenapati12 Aug 15, 2020
24c8539
Update index.jsp
csenapati12 Aug 16, 2020
6984ac0
Update pom.xml
csenapati12 Aug 16, 2020
e49756f
Update pom.xml
csenapati12 Aug 16, 2020
88963e0
Update pom.xml
csenapati12 Aug 16, 2020
da610ba
Update pom.xml
csenapati12 Aug 16, 2020
8cc9fc0
Update Dockerfile
csenapati12 Aug 16, 2020
bbf50ee
Update pom.xml
csenapati12 Aug 17, 2020
c71cfaa
Update pom.xml
csenapati12 Sep 27, 2020
4b4d63b
Update README.md
csenapati12 Nov 18, 2020
43b8560
Update README.md
csenapati12 Nov 18, 2020
c8d5a6b
Update README.md
csenapati12 Nov 18, 2020
1bb20c1
Update index.jsp
csenapati12 Dec 2, 2020
1655e4e
Update index.jsp
csenapati12 Dec 2, 2020
b75c4f1
Update README.md
csenapati12 Feb 27, 2021
1c95899
ansible
csenapati12 Mar 13, 2021
3304879
Update deployfile.yml
csenapati12 Mar 13, 2021
37faf19
Update pom.xml
csenapati12 Mar 13, 2021
429a608
Update deployfile.yml
csenapati12 Mar 13, 2021
cbeb620
Update deployfile.yml
csenapati12 Mar 13, 2021
4d1bb32
Update Jenkinsfile
csenapati12 Mar 14, 2021
b9e26bb
Update deployfile.yml
csenapati12 Mar 14, 2021
6387745
Update index.jsp
csenapati12 Mar 14, 2021
c9e9336
Update Jenkinsfile
csenapati12 Mar 14, 2021
d7f61b9
Create deploytomcat.yml
csenapati12 Mar 14, 2021
80e3415
Create Jenkinsfile-latest
csenapati12 Mar 14, 2021
68b8ab4
Create ansible-hosts
csenapati12 Mar 14, 2021
b46a0d8
Update Jenkinsfile-latest
csenapati12 Mar 14, 2021
bfdc833
Update ansible-hosts
csenapati12 Mar 14, 2021
c84683b
Update Dockerfile
csenapati12 Apr 4, 2021
6620cdc
Update Dockerfile
csenapati12 Apr 4, 2021
6785f5a
Update index.jsp
csenapati12 Apr 4, 2021
64bb382
Update Dockerfile
csenapati12 May 30, 2021
04461f6
Update Dockerfile
csenapati12 May 30, 2021
7f1d408
Update Jenkinsfile
csenapati12 Jun 13, 2021
4376cd9
Update Jenkinsfile
csenapati12 Jun 13, 2021
58cff91
Update Jenkinsfile
csenapati12 Jun 14, 2021
c35297c
Update Jenkinsfile
csenapati12 Jun 14, 2021
d38d847
Update Jenkinsfile
csenapati12 Jun 14, 2021
e6d071d
Update Dockerfile
csenapati12 Jul 26, 2021
0fa78f9
Revert "Update Jenkinsfile"
csenapati12 Jul 27, 2021
41ed03b
Update index.jsp
csenapati12 Aug 5, 2021
829325f
Update index.jsp
csenapati12 Aug 5, 2021
ec3d6db
Update pom.xml
csenapati12 Aug 5, 2021
7fc2f1a
Update pom.xml
csenapati12 Aug 5, 2021
d4113ed
Update pom.xml
csenapati12 Aug 5, 2021
5e0c432
Update pom.xml
csenapati12 Aug 5, 2021
5f238bd
Update pom.xml
csenapati12 Aug 15, 2021
37ece56
Update pom.xml
csenapati12 Aug 15, 2021
3a4dcb4
Update pom.xml
csenapati12 Aug 15, 2021
43f5929
Update index.jsp
csenapati12 Aug 15, 2021
2295672
Update pom.xml
csenapati12 Aug 15, 2021
def1bb8
Update README.md
csenapati12 Feb 22, 2022
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
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:16.04
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y curl && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:webupd8team/java -y && \
apt-get update && \
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
apt-get install -y openjdk-8-jdk && \
apt-get clean
RUN groupadd tomcat
RUN useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
RUN cd /tmp
RUN curl -O https://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.69/bin/apache-tomcat-8.5.69.tar.gz
RUN mkdir /opt/tomcat
RUN gzip -V
RUN tar -xvzf apache-tomcat-8.5.69.tar.gz -C /opt/tomcat --strip-components=1
RUN cd /opt/tomcat
RUN chgrp -R tomcat /opt/tomcat
ADD target/myapp.war /opt/tomcat/webapps
#RUN chown -R tomcat conf/ webapps/ work/ temp/ logs/
#RUN update-java-alternatives -l
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
Run cd /opt/tomcat/bin
expose 8080
#CMD /opt/tomcat/bin/catalina.sh run && tail -f /opt/tomcat/logs/catalina.out
CMD ["/opt/tomcat/bin/catalina.sh", "run"]
32 changes: 32 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
pipeline {
node { label "$NODE" }
parameters {
// gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH'
// parameters { string(name: 'NODE', defaultValue: 'some_node', description: '') }
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH',string(name: 'NODE', defaultValue: 'master', description: '')

}
stages {
stage('Checkout') {
steps {
git branch: "${params.BRANCH}", url: 'https://github.com/csenapati12/java-tomcat-maven-docker.git'

}
}
stage('Build and Package') {
steps {

script{
sh """
ls
# mvn clean package
echo "MAster"
ls -la
"""
}

}
}

}
}
21 changes: 21 additions & 0 deletions Jenkinsfile-back
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
node(){
checkout scm

stage('compile') {
echo "compile"
}
stage('test') {
echo "test"
}

stage('Maven Build') {

}
stage('deploy to nexus') {
echo "deploy"
}

stage('Docker Build') {
echo "Docker build"
}
}
26 changes: 26 additions & 0 deletions Jenkinsfile-docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
node(){
checkout scm
stage('Code build'){
sh "mvn package"
}
stage('Docker build and start'){
sh '''

docker build -t testimage .
docker run --name=newcontainer -d -p 9898:8080 testimage
'''
}
stage('Smoke testing and result'){
echo "smoke testing"
}

stage('Docker build and start'){
sh '''
docker stop newcontainer
docker rm -f newcontainer
docker rmi testimage

'''
}

}
25 changes: 25 additions & 0 deletions Jenkinsfile-latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pipeline{
agent any
stages{
stage("checkout"){
steps{
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/csenapati12/java-tomcat-maven-docker.git']]]
}
}
stage("Build and packaging"){
steps{
sh """
mvn clean package
"""
}
}
stage("Deploy tomcat"){
steps{
script{
ansiblePlaybook credentialsId: 'root-credentials', inventory: 'ansible-hosts', playbook: 'deploytomcat.yml'
}
}
}
}

}
21 changes: 21 additions & 0 deletions Jenkinsfile-new
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pipeline {

agent any
parameters {
choice choices: ['DeployL1_L2_L3', 'L4', 'L6'], description: 'Please select the environment to Deploy!!!', name: 'ENV_NAME'
choice choices: ['HSVALIDATION_BUSINESS_SERVICE', 'HSVALIDATION_DATA_SERVICE'], description: 'Please select the application!!!', name: 'APP_NAME'
choice choices: ['HSVALIDATION_BUSINESS_SERVICE1', 'HSVALIDATION_DATA_SERVICE2'], description: 'Please select the application!!!', name: 'APP_NAME'
}
stages {

stage('Code checkout') {
when {
expression { params.ENV_NAME =='DeployL1_L2_L3'}
}
steps {
echo "helllo"
}
}

}
}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//added new line for test pull SCM
//added new line for test pull SCM--->22ndfeb
//test multibranch
# java-tomcat-maven-example

#adding devops
This is an example ready-to-deploy java web application built for Tomcat using Maven and webapp-runner.

## Running Locally
Expand All @@ -23,6 +26,7 @@ The application will be available on `http://localhost:8080`.

2. Add the webapp-runner plugin into the `pom.xml`:

Test merge
```
<build>
<!-- ... -->
Expand Down
4 changes: 4 additions & 0 deletions ansible-hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deploy-tomcat]
#34.122.68.73
35.238.183.82
130.211.221.35
8 changes: 8 additions & 0 deletions deployfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- hosts: localhost
become: true
become_user: root
tasks:
- name: Copy the playbook
copy: src=/var/lib/jenkins/workspace/ansible-pipleline/target/myapp.war dest=/home/skylab_priyadarshini/tomcat8/webapps

7 changes: 7 additions & 0 deletions deploytomcat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- hosts: deploy-tomcat
become: true
become_user: root
tasks:
- name: Copy the artifact
copy: src=/var/lib/jenkins/workspace/ansible-pipleline/target/myapp.war dest=/home/tomcat/apache-tomcat-8.5.64/webapps
18 changes: 15 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<groupId>com.example</groupId>
<artifactId>java-tomcat-maven-example</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<version>5.0.1-SNAPSHOTS</version>
<name>hello Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<version>4.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>java-tomcat-maven-example</finalName>
<finalName>myapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -41,4 +41,16 @@
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>releases</id>
<!-- nexus server details for release -->
<url>http://34.133.198.104:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<!-- nexus server details for snapshots-->
<url>http://34.133.198.104:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>
9 changes: 7 additions & 2 deletions src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<html>
<body>
<h2>Hello World!</h2>
<body>
<marquee>
<h2 style="background-color:DodgerBlue;"> Welcome To</h2>
<h1 style="background-color:Tomato;"> Test App </h1>
<h2> !!!!!!!!!!!!!!!!!!15th Aug ?????????!!!!!!!!!!!!!!!!!!!!!!!!<h2>
</marquee>

</body>
</html>