diff --git a/Dockerfile b/Dockerfile index 171c9407fb..ffacf32b9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,3 @@ -# Pull base image -From tomcat:8-jre8 - -# Maintainer -MAINTAINER "valaxytech@gmail.com" -COPY ./webapp.war /usr/local/tomcat/webapps +FROM nginx:alpine +COPY ./index.html /usr/share/nginx/html diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..99dfebf158 --- /dev/null +++ b/Jenkinsfile @@ -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" + } + } + } + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000000..f826c1b7bb --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +Welcome my first app diff --git a/pom.xml b/pom.xml index 93eeb2de66..5c232a0a8f 100644 --- a/pom.xml +++ b/pom.xml @@ -22,12 +22,16 @@ - - site-server - Test Project Site - file:///tmp/maven-project-site - - + + nexus + http://34.226.202.185:8081/repository/snapshots/ + + + nexus + http://34.226.202.185:8081/repository/releases/ + + + @@ -175,6 +179,12 @@ jsp-api 2.2 + + com.vikas.apps + firstapp + 1.0.0 + war + junit diff --git a/settings.xml b/settings.xml new file mode 100644 index 0000000000..1c4ddc6f87 --- /dev/null +++ b/settings.xml @@ -0,0 +1,23 @@ + + + + nexus + jenkins + admin@123 + + + + + + + + nexus + Maven-Hosted + http://34.236.152.13:8081/repository/Maven-Hosted/ + + + + +