Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f2da528
Update pom.xml
PSRINVAS-729 Mar 28, 2025
0ce7fff
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
cd754ee
Delete .project
PSRINVAS-729 Mar 28, 2025
7aae78f
Delete Dockerfile-tomcat
PSRINVAS-729 Mar 28, 2025
b6b751f
Delete Dockerfile-mysql
PSRINVAS-729 Mar 28, 2025
af00534
Delete .classpath
PSRINVAS-729 Mar 28, 2025
fa6fab5
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
eb00392
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
b79b614
Update pom.xml
PSRINVAS-729 Mar 28, 2025
26aeb36
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
a12d8d3
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
19aceb1
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
52b8189
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
b152f5c
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
efc7d3f
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
1b40365
Update pom.xml
PSRINVAS-729 Mar 28, 2025
cc19618
Update pom.xml
PSRINVAS-729 Mar 28, 2025
2a83295
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
9c81ba7
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
464e42b
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
6ba56f5
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
a9a2ca7
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
d623c4b
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
1c15625
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
c204de1
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
c4ab461
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
3329e21
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
b69344e
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
ec93f3f
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
142a502
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
e9790b1
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
56e859a
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
258b43b
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
e030044
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
470da2e
Update Jenkinsfile
PSRINVAS-729 Mar 28, 2025
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
47 changes: 0 additions & 47 deletions .classpath

This file was deleted.

36 changes: 0 additions & 36 deletions .project

This file was deleted.

5 changes: 0 additions & 5 deletions Dockerfile-mysql

This file was deleted.

9 changes: 0 additions & 9 deletions Dockerfile-tomcat

This file was deleted.

79 changes: 63 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,78 @@
// pipeline {
// agent any
// tools {
// maven "MAVEN"
// jdk "JDK"
// }

// environment {
// NEXUS_VERSION = "nexus3" // Nexus 3 or Nexus 2
// NEXUS_PROTOCOL = "http" // HTTP or HTTPS
// NEXUS_URL = "13.126.159.57:8081" // Nexus Server IP and Port
// NEXUS_REPOSITORY = "logicwebapp" // Nexus Repository Name
// NEXUS_CREDENTIAL_ID = "Nexus" // Jenkins Credential ID for Nexus
// ARTIFACT_VERSION = "${BUILD_NUMBER}" // Versioning
// GROUP_ID = "com/psrinivas"
// ARTIFACT_ID = "loginwebapp"
// }

// stages {
// stage("Checkout Code") {
// steps {
// script {
// git branch: 'feature/nexusUpload', url: 'https://github.com/PSRINVAS-729/LoginWebApp.git'
// }
// }
// }

// stage("Maven Build") {
// steps {
// sh "mvn clean install"
// }
// }

// stage("Upload Artifact to Nexus") {
// steps {
// withCredentials([usernamePassword(credentialsId: 'Nexus', usernameVariable: 'NEXUS_USER', passwordVariable: 'NEXUS_PASS')]) {
// sh """
// curl -v -u ${NEXUS_USER}:${NEXUS_PASS} --upload-file target/LoginWebApp.war ${NEXUS_URL}/repository/${NEXUS_REPOSITORY}/${GROUP_ID}/${ARTIFACT_ID}/${ARTIFACT_VERSION}/${ARTIFACT_ID}-${ARTIFACT_VERSION}.war
// """
// }
// }
// }
// }
// }
// s3 upload
pipeline {
agent any
tools {
maven 'localMaven'
maven "MAVEN"
jdk "JDK"
}

parameters {
string(name: 'tomcat_stag', defaultValue: '35.154.81.229', description: 'Tomcat Staging Server')
environment {
S3_BUCKET = "jenkinss322"
AWS_REGION = "ap-south-1" // Change based on your region
AWS_CREDENTIALS_ID = "s3"
}

stages{
stage('Build'){
stages {
stage("Checkout Code") {
steps {
sh 'mvn clean package'
git branch: 'feature/nexusUpload', url: 'https://github.com/PSRINVAS-729/LoginWebApp.git'
}
post {
success {
echo 'Archiving the artifacts'
archiveArtifacts artifacts: '**/*.war'
}
}

stage("Maven Build") {
steps {
sh "mvn clean install"
}
}

stage ('Deployments'){
stage ('Deploy to Staging Server'){
steps {
sh "scp **/*.war jenkins@${params.tomcat_stag}:/usr/share/tomcat/webapps"
}
stage("Upload to S3") {
steps {
withAWS(credentials: 's3', region: "${AWS_REGION}") {
sh "whoami"
}
}
}
Expand Down
100 changes: 71 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,72 @@
<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.ranjitswain</groupId>
<artifactId>LoginWebApp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>LoginWebApp Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.12</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
</dependencies>
<build>
<finalName>LoginWebApp</finalName>
</build>
<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.PSRINIVAS-729</groupId>
<artifactId>logicwebapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>

<name>LoginWebApp Maven Webapp</name>
<url>http://maven.apache.org</url>

<dependencies>
<!-- Servlet API (Updated to 4.0 for better compatibility) -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>

<!-- MySQL Connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.12</version>
</dependency>

<!-- JUnit for Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>LoginWebApp</finalName>

<plugins>
<!-- Compiler Plugin (Set Java 8 or higher) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

<!-- WAR Plugin (Updated for Java compatibility) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
</plugins>
</build>

<!-- Repositories -->
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>

</project>