Skip to content

Commit e2be9ed

Browse files
committed
DevOps: Push DevOps-Project-05
* Deploy your code on a Docker Container using Jenkins on AWS Signed-off-by: NotHarshhaa <reddyharshhaa12@gmail.com>
1 parent c5fdc74 commit e2be9ed

File tree

12 files changed

+998
-0
lines changed

12 files changed

+998
-0
lines changed

DevOps Project-05/Project-05.md

Lines changed: 522 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM tomcat:latest
2+
RUN cp -R /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps
3+
COPY ./*.war /usr/local/tomcat/webapps
4+

DevOps Project-05/hello-world/pom.xml

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.example.maven-project</groupId>
7+
<artifactId>maven-project</artifactId>
8+
<packaging>pom</packaging>
9+
<version>1.0-SNAPSHOT</version>
10+
<name>Maven Project</name>
11+
<description>Sample Maven project with a working, deployable site.</description>
12+
<url>http://www.example.com</url>
13+
14+
<properties>
15+
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
16+
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
17+
</properties>
18+
19+
<modules>
20+
<module>server</module>
21+
<module>webapp</module>
22+
</modules>
23+
24+
<distributionManagement>
25+
<site>
26+
<id>site-server</id>
27+
<name>Test Project Site</name>
28+
<url>file:///tmp/maven-project-site</url>
29+
</site>
30+
</distributionManagement>
31+
32+
<build>
33+
<plugins>
34+
<plugin>
35+
<artifactId>maven-compiler-plugin</artifactId>
36+
<configuration>
37+
<source>1.7</source>
38+
<target>1.7</target>
39+
</configuration>
40+
</plugin>
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-war-plugin</artifactId>
44+
<version>3.3.2</version>
45+
<configuration>
46+
<failOnMissingWebXml>false</failOnMissingWebXml>
47+
</configuration>
48+
</plugin>
49+
<plugin>
50+
<artifactId>maven-release-plugin</artifactId>
51+
<configuration>
52+
<autoVersionSubmodules>true</autoVersionSubmodules>
53+
</configuration>
54+
</plugin>
55+
56+
<plugin>
57+
<artifactId>maven-site-plugin</artifactId>
58+
<configuration>
59+
<reportPlugins>
60+
<plugin>
61+
<artifactId>maven-checkstyle-plugin</artifactId>
62+
</plugin>
63+
64+
<plugin>
65+
<artifactId>maven-jxr-plugin</artifactId>
66+
</plugin>
67+
68+
<plugin>
69+
<artifactId>maven-javadoc-plugin</artifactId>
70+
</plugin>
71+
72+
<plugin>
73+
<artifactId>maven-pmd-plugin</artifactId>
74+
</plugin>
75+
76+
<plugin>
77+
<artifactId>maven-surefire-report-plugin</artifactId>
78+
</plugin>
79+
80+
<plugin>
81+
<groupId>org.codehaus.mojo</groupId>
82+
<artifactId>findbugs-maven-plugin</artifactId>
83+
</plugin>
84+
85+
<plugin>
86+
<groupId>org.codehaus.mojo</groupId>
87+
<artifactId>taglist-maven-plugin</artifactId>
88+
</plugin>
89+
</reportPlugins>
90+
</configuration>
91+
</plugin>
92+
</plugins>
93+
94+
<pluginManagement>
95+
<plugins>
96+
<plugin>
97+
<artifactId>maven-checkstyle-plugin</artifactId>
98+
<version>2.8</version>
99+
</plugin>
100+
101+
<plugin>
102+
<artifactId>maven-compiler-plugin</artifactId>
103+
<version>2.3.2</version>
104+
</plugin>
105+
106+
<plugin>
107+
<artifactId>maven-javadoc-plugin</artifactId>
108+
<version>2.8</version>
109+
</plugin>
110+
111+
<plugin>
112+
<artifactId>maven-jxr-plugin</artifactId>
113+
<version>2.3</version>
114+
</plugin>
115+
116+
<plugin>
117+
<artifactId>maven-pmd-plugin</artifactId>
118+
<version>2.6</version>
119+
</plugin>
120+
121+
<plugin>
122+
<artifactId>maven-project-info-reports-plugin</artifactId>
123+
<version>2.4</version>
124+
</plugin>
125+
126+
<plugin>
127+
<artifactId>maven-release-plugin</artifactId>
128+
<version>2.2.1</version>
129+
</plugin>
130+
131+
<plugin>
132+
<artifactId>maven-resources-plugin</artifactId>
133+
<version>2.5</version>
134+
</plugin>
135+
136+
<plugin>
137+
<artifactId>maven-site-plugin</artifactId>
138+
<version>3.0</version>
139+
</plugin>
140+
141+
<plugin>
142+
<artifactId>maven-surefire-report-plugin</artifactId>
143+
<version>2.11</version>
144+
</plugin>
145+
146+
<plugin>
147+
<artifactId>maven-surefire-plugin</artifactId>
148+
<version>2.11</version>
149+
</plugin>
150+
151+
<plugin>
152+
<groupId>org.codehaus.mojo</groupId>
153+
<artifactId>findbugs-maven-plugin</artifactId>
154+
<version>2.3.3</version>
155+
</plugin>
156+
157+
<plugin>
158+
<groupId>org.codehaus.mojo</groupId>
159+
<artifactId>taglist-maven-plugin</artifactId>
160+
<version>2.4</version>
161+
</plugin>
162+
163+
<plugin>
164+
<groupId>org.mortbay.jetty</groupId>
165+
<artifactId>jetty-maven-plugin</artifactId>
166+
<version>8.0.0.M1</version>
167+
</plugin>
168+
</plugins>
169+
</pluginManagement>
170+
</build>
171+
172+
<dependencyManagement>
173+
<dependencies>
174+
<dependency>
175+
<groupId>javax.servlet</groupId>
176+
<artifactId>servlet-api</artifactId>
177+
<version>2.5</version>
178+
</dependency>
179+
180+
<dependency>
181+
<groupId>javax.servlet.jsp</groupId>
182+
<artifactId>jsp-api</artifactId>
183+
<version>2.2</version>
184+
</dependency>
185+
186+
<dependency>
187+
<groupId>junit</groupId>
188+
<artifactId>junit-dep</artifactId>
189+
<version>4.10</version>
190+
<scope>test</scope>
191+
</dependency>
192+
193+
<dependency>
194+
<groupId>org.hamcrest</groupId>
195+
<artifactId>hamcrest-core</artifactId>
196+
<version>1.2.1</version>
197+
<scope>test</scope>
198+
</dependency>
199+
200+
<dependency>
201+
<groupId>org.hamcrest</groupId>
202+
<artifactId>hamcrest-library</artifactId>
203+
<version>1.2.1</version>
204+
<scope>test</scope>
205+
</dependency>
206+
207+
<dependency>
208+
<groupId>org.mockito</groupId>
209+
<artifactId>mockito-core</artifactId>
210+
<version>1.8.5</version>
211+
<scope>test</scope>
212+
</dependency>
213+
</dependencies>
214+
</dependencyManagement>
215+
216+
<scm>
217+
<connection>scm:git:git@github.com:jleetutorial/maven-project.git</connection>
218+
<developerConnection>scm:git:git@github.com:jleetutorial/maven-project.git</developerConnection>
219+
<tag>HEAD</tag>
220+
<url>http://github.com/jleetutorial/maven-project</url>
221+
</scm>
222+
223+
<prerequisites>
224+
<maven>3.0.3</maven>
225+
</prerequisites>
226+
227+
</project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: valaxy-regapp
5+
labels:
6+
app: regapp
7+
8+
spec:
9+
replicas: 2
10+
selector:
11+
matchLabels:
12+
app: regapp
13+
14+
template:
15+
metadata:
16+
labels:
17+
app: regapp
18+
spec:
19+
containers:
20+
- name: regapp
21+
image: valaxy/regapp
22+
imagePullPolicy: Always
23+
ports:
24+
- containerPort: 8080
25+
strategy:
26+
type: RollingUpdate
27+
rollingUpdate:
28+
maxSurge: 1
29+
maxUnavailable: 1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: valaxy-service
5+
labels:
6+
app: regapp
7+
spec:
8+
selector:
9+
app: regapp
10+
11+
ports:
12+
- port: 8080
13+
targetPort: 8080
14+
15+
type: LoadBalancer
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>com.example.maven-project</groupId>
8+
<artifactId>maven-project</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>server</artifactId>
14+
<packaging>jar</packaging>
15+
<name>Server</name>
16+
<description>Logic.</description>
17+
18+
<build>
19+
<finalName>${project.artifactId}</finalName>
20+
</build>
21+
22+
<dependencies>
23+
<dependency>
24+
<groupId>junit</groupId>
25+
<artifactId>junit-dep</artifactId>
26+
<scope>test</scope>
27+
</dependency>
28+
29+
<dependency>
30+
<groupId>org.hamcrest</groupId>
31+
<artifactId>hamcrest-core</artifactId>
32+
<scope>test</scope>
33+
</dependency>
34+
35+
<dependency>
36+
<groupId>org.hamcrest</groupId>
37+
<artifactId>hamcrest-library</artifactId>
38+
<scope>test</scope>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>org.mockito</groupId>
43+
<artifactId>mockito-core</artifactId>
44+
<scope>test</scope>
45+
</dependency>
46+
</dependencies>
47+
48+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.example;
2+
3+
/**
4+
* This is a class.
5+
*/
6+
public class Greeter {
7+
8+
/**
9+
* This is a constructor.
10+
*/
11+
public Greeter() {
12+
13+
}
14+
15+
//TODO: Add javadoc comment
16+
public String greet(String someone) {
17+
return String.format("Hello, %s!", someone);
18+
}
19+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Headline
2+
3+
Content
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.example;
2+
3+
import org.junit.Before;
4+
import org.junit.Test;
5+
6+
import static org.hamcrest.CoreMatchers.is;
7+
import static org.hamcrest.Matchers.greaterThan;
8+
import static org.junit.Assert.assertThat;
9+
import static org.junit.matchers.JUnitMatchers.containsString;
10+
11+
public class TestGreeter {
12+
13+
private Greeter greeter;
14+
15+
@Before
16+
public void setup() {
17+
greeter = new Greeter();
18+
}
19+
20+
@Test
21+
public void greetShouldIncludeTheOneBeingGreeted() {
22+
String someone = "World";
23+
24+
assertThat(greeter.greet(someone), containsString(someone));
25+
}
26+
27+
@Test
28+
public void greetShouldIncludeGreetingPhrase() {
29+
String someone = "World";
30+
31+
assertThat(greeter.greet(someone).length(), is(greaterThan(someone.length())));
32+
}
33+
}

0 commit comments

Comments
 (0)