Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Pull base image
From tomcat:8-jre8

# Maintainer
MAINTAINER "[email protected]"
COPY ./webapp.war /usr/local/tomcat/webapps

FROM nginx:alpine
COPY ./index.html /usr/share/nginx/html
28 changes: 28 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pipeline{
agent {label 'slave1'}
//environment {
// PATH = "$PATH:/opt/apache-maven-3.8.2/bin"
//}
stages{
stage('GetCode'){
steps{
git 'https://github.com/Sharath8000/hello-world.git'
}
}
stage('Docker image build'){
steps {
sh 'mvn clean deploy'
}
}
stage('SonarQube analysis') {
// def scannerHome = tool 'SonarScanner 4.0';
steps{
withSonarQubeEnv('sonarqube') {
// If you have configured more than one global server connection, you can specify its name
// sh "${scannerHome}/bin/sonar-scanner"
sh "mvn sonar:sonar"
}
}
}
}
}
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Welcome my first app
22 changes: 16 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
</modules>

<distributionManagement>
<site>
<id>site-server</id>
<name>Test Project Site</name>
<url>file:///tmp/maven-project-site</url>
</site>
</distributionManagement>
<snapshotRepository>
<id>nexus</id>
<url>http://34.226.202.185:8081/repository/snapshots/</url>
</snapshotRepository>
<repository>
<id>nexus</id>
<url>http://34.226.202.185:8081/repository/releases/</url>
</repository>

</distributionManagement>

<build>
<plugins>
Expand Down Expand Up @@ -175,6 +179,12 @@
<artifactId>jsp-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.vikas.apps</groupId>
<artifactId>firstapp</artifactId>
<version>1.0.0</version>
<type>war</type>
</dependency>

<dependency>
<groupId>junit</groupId>
Expand Down
23 changes: 23 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<server>
<id>nexus</id>
<username>jenkins</username>
<password>admin@123</password>
</server>


<profiles>
<profile>
<repositories>
<repository>
<id>nexus</id>
<name>Maven-Hosted</name>
<url>http://34.236.152.13:8081/repository/Maven-Hosted/</url>
</repository>
</repositories>
</profile>
</profiles>
</settings>