Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
legah2045 authored Sep 17, 2020
0 parents commit 146c55f
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu
RUN echo "Run One Updated"
RUN echo "RUN TWO"
RUN echo "RUN Three"
CMD date
ENTRYPOINT [ "echo", "hello" ]


#git
FROM alpine/git as repo

MAINTAINER name [email protected]

WORKDIR /app
RUN git clone https://github.com/LandmakTechnology/maven-web-app.git

#Maven
FROM maven:3.5-jdk-8-alpine as build
WORKDIR /app
COPY --from=repo /app/maven-web-app /app
RUN mvn install

#Tomcat
FROM tomcat:8.0.20-jre8
COPY --from=build /app/target/maven-web-app*.war /usr/local/tomcat/webapps/maven-web-app.war


2 changes: 2 additions & 0 deletions Dockerfile_CMD
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM ubuntu
CMD ["echo" ,"FROM DockerFile"]
3 changes: 3 additions & 0 deletions Dockerfile_CMDENT
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ubuntu
CMD ["echo" ,"FROM DockerFile"]
ENTRYPOINT ["ls", "/"]
2 changes: 2 additions & 0 deletions Dockerfile_ENTRYPOINT
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM ubuntu
ENTRYPOINT ["echo" ,"FROM DockerFile"]
4 changes: 4 additions & 0 deletions Dockerfile_Tomcat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM tomcat:8.0.20-jre8
RUN sed -i '/<\/tomcat-users>/ i\<user username="admin" password="password" roles="admin-gui,manager-gui"/>' /usr/local/tomcat/conf/tomcat-users.xml
#COPY tomcat-users.xml /usr/local/tomcat/conf/tomcat-users.xml
COPY java-web-app.war /usr/local/tomcat/webapps/gradle-web-app.war
19 changes: 19 additions & 0 deletions Dockerfile_Tomcat_CentOs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM centos

MAINTAINER [email protected]

RUN mkdir /opt/tomcat/

WORKDIR /opt/tomcat
#RUN curl -O https://downloads.apache.org/tomcat/tomcat-9/v9.0.38/bin/apache-tomcat-9.0.38.tar.gz
ADD https://downloads.apache.org/tomcat/tomcat-9/v9.0.38/bin/apache-tomcat-9.0.38.tar.gz .
RUN tar xvfz apache*.tar.gz
RUN mv apache-tomcat-9.0.37/* /opt/tomcat/.
RUN yum -y install java
RUN java -version

WORKDIR /opt/tomcat/webapps

EXPOSE 8080

CMD ["/opt/tomcat/bin/catalina.sh", "run"]
9 changes: 9 additions & 0 deletions Dockerfile_Tomcat_Ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:latest
RUN apt-get -y update && apt-get -y upgrade \
&& apt-get -y install openjdk-8-jdk wget
RUN mkdir /usr/local/tomcat
RUN wget http://apachemirror.wuchna.com/tomcat/tomcat-8/v8.5.46/bin/apache-tomcat-8.5.46.tar.gz -O /tmp/tomcat.tar.gz
RUN cd /tmp && tar xvfz tomcat.tar.gz \
&& cp -Rv /tmp/apache-tomcat-8.5.46/* /usr/local/tomcat/
EXPOSE 8080
CMD /usr/local/tomcat/bin/catalina.sh run
3 changes: 3 additions & 0 deletions Dockerfile_Wildfly
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM jboss/wildfly

ADD target/maven-web-app.war /opt/jboss/wildfly/standalone/deployments/
5 changes: 5 additions & 0 deletions Dockerfile_Wildfly_Admin
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM jboss/wildfly

RUN /opt/jboss/wildfly/bin/add-user.sh admin password --silent

CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
2 changes: 2 additions & 0 deletions Dockerfile_nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx:alpine
COPY index.html /usr/share/nginx/html
17 changes: 17 additions & 0 deletions MultiStageDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#git
FROM alpine/git as repo

MAINTAINER [email protected]

WORKDIR /app
RUN git clone https://github.com/LandmakTechnology/maven-web-app.git

#Maven
FROM maven:3.5-jdk-8-alpine as build
WORKDIR /app
COPY --from=repo /app/maven-web-app /app
RUN mvn install

#Tomcat
FROM tomcat:8.0.20-jre8
COPY --from=build /app/target/maven-web-app*.war /usr/local/tomcat/webapps/maven-web-app.war
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Hello World</h1>
Binary file added java-web-app.war
Binary file not shown.
52 changes: 52 additions & 0 deletions node.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
node
{
def mavenHome = tool name: "maven3.6.3"

stage("CodeClone")
{
git credentialsId: 'gitCredentials', url: 'https://github.com/LandmakTechnology/maven-web-app.git'
}
stage("CreatePackage")
{
sh "${mavenHome}/bin/mvn clean package"
}

stage('CodeQualityReports')
{
//sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('UploadBuildArtifacts')
{
sh "${mavenHome}/bin/mvn deploy"
}
stage('Deploy2Tomcat')
{
deploy adapters: [tomcat9(credentialsId: 'TomcatCredentials', path: '', url: 'http://34.239.176.96:8080/')], contextPath: null, war: '**/maven-web-app.war'
}
stage('BuildDockerImage')
{
//sh "docker stop myapp"
//sh "docker rm -f myapp"
sh "docker rmi -f mylandmarktech/maven-web-app"
sh "docker build -t mylandmarktech/maven-web-app ."
}
stage('Push2DockerHub')
{
withCredentials([string(credentialsId: 'DockerHubPwd', variable: 'DockerHubPwd')]) {
sh "docker login -u mylandmarktech -p $DockerHubPwd"
}
}
sh "docker push mylandmarktech/maven-web-app"
}
stage('DeployAppInDockerContainer')
{
sh "docker run -d -p 8888:8080 --name myapp mylandmarktech/maven-web-app"
}
stage('Email notification')
{
emailext body: '''
Build Status
Landmark Technology
+ 1 437 215 2483\'\'\', recipientProviders: [developers()], subject: \'Build status\', to: \'[email protected]\'''', recipientProviders: [developers()], subject: 'Build', to: '[email protected]'
}
}
46 changes: 46 additions & 0 deletions tomcat-users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->

<user username="admin" password="password" roles="admin-gui,manager-gui"/>
</tomcat-users>

0 comments on commit 146c55f

Please sign in to comment.