-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 146c55f
Showing
15 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM ubuntu | ||
CMD ["echo" ,"FROM DockerFile"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM ubuntu | ||
CMD ["echo" ,"FROM DockerFile"] | ||
ENTRYPOINT ["ls", "/"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM ubuntu | ||
ENTRYPOINT ["echo" ,"FROM DockerFile"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM nginx:alpine | ||
COPY index.html /usr/share/nginx/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Hello World</h1> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |