diff --git a/JenkinsJFrogWebapps b/JenkinsJFrogWebapps new file mode 100644 index 0000000..e2ca008 --- /dev/null +++ b/JenkinsJFrogWebapps @@ -0,0 +1,44 @@ +pipeline { + agent { + label 'angular' + } + stages { + stage('Checkout-stage') { + steps { + git branch: 'main', credentialsId: 'github', url: 'https://github.com/Jayachandran-S7/java-example.git' + echo 'repo cloning' + } + } + stage('Build-stage') { + steps { + sh 'mvn clean package' + echo 'package distribution done' + } + } + stage('push-to-artifactory') { + steps { + script { + // Upload to Artifactory + rtServer ( + id: 'server-1', + url: 'http://3.108.41.148:8081/artifactory', + credentialsId: 'jfrog-connection', + timeout: 300 + ) + rtUpload ( + serverId: 'server-1', + spec: '''{ + "files": [ + { + "pattern": "target/works-with-heroku-1.0.war", + "target": "Maven/test1.war" + } + ] + }''' + ) + } + echo 'Done with pushing artifact into JFrog Artifactory' + } + } + } +} diff --git a/JenkinsJayaSonar b/JenkinsJayaSonar new file mode 100644 index 0000000..3348ad4 --- /dev/null +++ b/JenkinsJayaSonar @@ -0,0 +1,22 @@ +pipeline{ + agent {label 'angular'} + stages{ + stage('Git Checkout Stage'){ + steps{ + git branch: 'main', url: 'https://github.com/Jayachandran-S7/java-example.git' + } + } + stage('Build Stage'){ + steps{ + sh 'mvn clean install' + } + } + stage('SonarQube Analysis Stage') { + steps{ + withSonarQubeEnv('SonarQube-Server') { + sh "mvn clean verify sonar:sonar" + } + } + } + } +} diff --git a/JenkinsWebapps b/JenkinsWebapps new file mode 100644 index 0000000..df772ee --- /dev/null +++ b/JenkinsWebapps @@ -0,0 +1,34 @@ +pipeline{ + agent { + label 'angular' + } + stages { + stage('Checkout-stage') { + steps { + git branch: 'main', credentialsId: 'github', url: 'https://github.com/Jayachandran-S7/java-example.git' + echo 'repo cloning' + } + } + + stage('Test-stage') { + steps { + echo 'This is a testcase and taken care while building an aritfact itself' + } + } + + stage('Build-stage') { + steps { + sh 'mvn clean package' + echo 'package distribution done' + } + } + + stage('Deploy-stage') { + steps { + sh 'sudo cp target/*.war /opt/tomcat/apache-tomcat-9.0.68/webapps' + echo 'copied java war file into tomcat webapps folder to configure web element integration' + } + } + + } +}