diff --git a/Jenkinsfile b/Jenkinsfile index 964fe40..b280123 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,27 +3,60 @@ pipeline { stages { + stage('Clean Workspace') { + steps { + cleanWs() + } + } + stage('checkout') { steps { - echo 'git checkout stage' - git branch: 'main', url: 'https://github.com/devopstraininghub/mindcircuit17d.git' - } - } + script { + try { + echo 'git checkout stage' + git branch: 'main', url: 'https://github.com/sivaramani12/mindcircuit-forked.git' + } + catch (Exception e) { + echo "${e.message}" + } + } + } + } stage('build') { steps { echo 'Building with maven ' - sh 'mvn clean install ' + sh 'mvn clean install ' } } - - stage('Deploy') { - steps { - echo 'Deploying to tomcat' - deploy adapters: [tomcat9(alternativeDeploymentContext: '', credentialsId: 'tomcat', path: '', url: 'http://54.160.144.88:8081/')], contextPath: 'insta', war: '**/*.war' + + stage('Deploy Parallel') { + parallel{ + stage('Deploy to test') { + steps { + echo 'Deploying to tomcat test env' + deploy adapters: [tomcat9(alternativeDeploymentContext: '', credentialsId: 'tomcat', path: '', url: 'http://3.94.113.81:8080/')], contextPath: 'practice_29apr_2', war: '**/*.war' + + } + } - } - } + stage('Deploy to stage') { + steps { + echo 'Deploying to tomcat stage env' + // deploy adapters: [tomcat9(alternativeDeploymentContext: '', credentialsId: 'tomcat', path: '', url: 'http://3.94.113.81:8080/')], contextPath: 'practice_29apr', war: '**/*.war' + + } + } + + stage('Deploy to dev') { + steps { + echo 'Deploying to tomcat dev env' + // deploy adapters: [tomcat9(alternativeDeploymentContext: '', credentialsId: 'tomcat', path: '', url: 'http://3.94.113.81:8080/')], contextPath: 'practice_29apr', war: '**/*.war' + + } + } + } + } } } diff --git a/Sample.txt b/Sample.txt new file mode 100644 index 0000000..b4f8b36 --- /dev/null +++ b/Sample.txt @@ -0,0 +1 @@ +This is a sample file \ No newline at end of file diff --git a/Sample2.txt b/Sample2.txt new file mode 100644 index 0000000..d2a6cd2 --- /dev/null +++ b/Sample2.txt @@ -0,0 +1 @@ +siva \ No newline at end of file diff --git a/pom.xml b/pom.xml index ca8196a..556ec65 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.example facebookapp - 1.0.0 + 1.0.0-SNAPSHOT war @@ -17,12 +17,12 @@ NexusRepo - http://34.201.119.102:8081/repository/batch16d-repo-snapshot/ + http://98.91.18.133:8081/repository/Sample-repo-snapshot// NexusRepo - http://34.201.119.102:8081/repository/batch16d-repo-release/ + http://98.91.18.133:8081/repository/Sample-repo-release// diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 6356818..42ec0e0 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -2,7 +2,7 @@ -

WELCOME TO JENKINS PIPELINE WORLD

+

Hi welcome to siva's repoooooooooo. Today's date is 22/04/26