Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pipeline {
agent {label 'agent'}
tools {
jdk 'java17'
maven 'Maven3'
}
stages {
stage ("Cleanup Workspace") {
steps {
cleanWs()
}
}

stage ("Checkout From SCM"){
steps {
git branch: 'main',credentialsId: 'github',url: 'https://github.com/Yodhagk/registration-app.git'
}
}
stage("Build Application") {
steps{
sh "mvn clean package"
}
}


}

}
4 changes: 4 additions & 0 deletions register-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM tomcat:latest
RUN cp -R /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps
COPY ./*.war /usr/local/tomcat/webapps

28 changes: 28 additions & 0 deletions register-app/Jenkinfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pipeline {
agent {label 'Jenkins-Agent'}
tools {
jdk 'java 17'
maven 'Maven3'
}
stages {
stage ("Cleanup Workspace") {
steps {
cleanWs()
}
}

stage ("Checkout From SCM"){
steps {
git branch: 'main',credentialsId: 'github',url: 'https://github.com/Yodhagk/registration-app.git'
}
}
stage("Build Application") {
steps{
sh "mvn clean package"
}
}


}

}
3 changes: 3 additions & 0 deletions register-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
registration-app
<br>
Test33
227 changes: 227 additions & 0 deletions register-app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.example.maven-project</groupId>
<artifactId>maven-project</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Project</name>
<description>Sample Maven project with a working, deployable site.</description>
<url>http://www.example.com</url>

<properties>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>utf-8</project.reporting.outputEncoding>
</properties>

<modules>
<module>server</module>
<module>webapp</module>
</modules>

<distributionManagement>
<site>
<id>site-server</id>
<name>Test Project Site</name>
<url>file:///tmp/maven-project-site</url>
</site>
</distributionManagement>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>

<plugin>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<reportPlugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.8</version>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>

<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
</plugin>

<plugin>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>

<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>2.6</version>
</plugin>

<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
</plugin>

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>

<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
</plugin>

<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.11</version>
</plugin>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3.3</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.0.0.M1</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

<scm>
<connection>scm:git:git@github.com:jleetutorial/maven-project.git</connection>
<developerConnection>scm:git:git@github.com:jleetutorial/maven-project.git</developerConnection>
<tag>HEAD</tag>
<url>http://github.com/jleetutorial/maven-project</url>
</scm>

<prerequisites>
<maven>3.0.3</maven>
</prerequisites>

</project>
29 changes: 29 additions & 0 deletions register-app/regapp-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: regapp-deployment
labels:
app: regapp

spec:
replicas: 2
selector:
matchLabels:
app: regapp

template:
metadata:
labels:
app: regapp
spec:
containers:
- name: regapp
image: ashfaque9x/regapp
imagePullPolicy: Always
ports:
- containerPort: 8080
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
15 changes: 15 additions & 0 deletions register-app/regapp-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: regapp-service
labels:
app: regapp
spec:
selector:
app: regapp

ports:
- port: 8080
targetPort: 8080

type: LoadBalancer
48 changes: 48 additions & 0 deletions register-app/server/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.example.maven-project</groupId>
<artifactId>maven-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>server</artifactId>
<packaging>jar</packaging>
<name>Server</name>
<description>Logic.</description>

<build>
<finalName>${project.artifactId}</finalName>
</build>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Loading