From c25c9630347ab80598fd2321d91dbea5907015b8 Mon Sep 17 00:00:00 2001 From: Imran Teli Date: Sat, 1 Jul 2023 13:08:45 +0530 Subject: [PATCH 01/64] jenkins userdata --- Jenkinsfile | 4 +- userdata/jenkins-setup.sh | 15 ++++ userdata/nexus-setup.sh | 35 +++++++++ userdata/sonar-analysis-properties | 10 +++ userdata/sonar-setup.sh | 119 +++++++++++++++++++++++++++++ 5 files changed, 181 insertions(+), 2 deletions(-) create mode 100644 userdata/jenkins-setup.sh create mode 100644 userdata/nexus-setup.sh create mode 100644 userdata/sonar-analysis-properties create mode 100644 userdata/sonar-setup.sh diff --git a/Jenkinsfile b/Jenkinsfile index be7508be5..969d00c6e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { NEXUS_PROTOCOL = "http" NEXUS_URL = "172.31.40.209:8081" NEXUS_REPOSITORY = "vprofile-release" - NEXUS_REPO_ID = "vprofile-release" + NEXUS_REPOGRP_ID = "vprofile-grp-repo" NEXUS_CREDENTIAL_ID = "nexuslogin" ARTVERSION = "${env.BUILD_ID}" } @@ -91,7 +91,7 @@ pipeline { nexusVersion: NEXUS_VERSION, protocol: NEXUS_PROTOCOL, nexusUrl: NEXUS_URL, - groupId: pom.groupId, + groupId: NEXUS_REPOGRP_ID, version: ARTVERSION, repository: NEXUS_REPOSITORY, credentialsId: NEXUS_CREDENTIAL_ID, diff --git a/userdata/jenkins-setup.sh b/userdata/jenkins-setup.sh new file mode 100644 index 000000000..7c849fc68 --- /dev/null +++ b/userdata/jenkins-setup.sh @@ -0,0 +1,15 @@ +#!/bin/bash +sudo apt update +sudo apt install openjdk-11-jdk -y +sudo apt install maven wget unzip -y + +curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \ + /usr/share/keyrings/jenkins-keyring.asc > /dev/null + +echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ + https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ + /etc/apt/sources.list.d/jenkins.list > /dev/null + +sudo apt-get update +sudo apt-get install jenkins -y +### diff --git a/userdata/nexus-setup.sh b/userdata/nexus-setup.sh new file mode 100644 index 000000000..f3fadecc6 --- /dev/null +++ b/userdata/nexus-setup.sh @@ -0,0 +1,35 @@ +#!/bin/bash +yum install java-1.8.0-openjdk.x86_64 wget -y +mkdir -p /opt/nexus/ +mkdir -p /tmp/nexus/ +cd /tmp/nexus/ +NEXUSURL="https://download.sonatype.com/nexus/3/latest-unix.tar.gz" +wget $NEXUSURL -O nexus.tar.gz +EXTOUT=`tar xzvf nexus.tar.gz` +NEXUSDIR=`echo $EXTOUT | cut -d '/' -f1` +rm -rf /tmp/nexus/nexus.tar.gz +rsync -avzh /tmp/nexus/ /opt/nexus/ +useradd nexus +chown -R nexus.nexus /opt/nexus +cat <> /etc/systemd/system/nexus.service +[Unit] +Description=nexus service +After=network.target + +[Service] +Type=forking +LimitNOFILE=65536 +ExecStart=/opt/nexus/$NEXUSDIR/bin/nexus start +ExecStop=/opt/nexus/$NEXUSDIR/bin/nexus stop +User=nexus +Restart=on-abort + +[Install] +WantedBy=multi-user.target + +EOT + +echo 'run_as_user="nexus"' > /opt/nexus/$NEXUSDIR/bin/nexus.rc +systemctl daemon-reload +systemctl start nexus +systemctl enable nexus diff --git a/userdata/sonar-analysis-properties b/userdata/sonar-analysis-properties new file mode 100644 index 000000000..8751fe7fd --- /dev/null +++ b/userdata/sonar-analysis-properties @@ -0,0 +1,10 @@ +sonar.projectKey=vprofile +sonar.projectName=vprofile-repo +sonar.projectVersion=1.0 +sonar.sources=src/ +sonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ +sonar.junit.reportsPath=target/surefire-reports/ +sonar.jacoco.reportsPath=target/jacoco.exec +sonar.java.checkstyle.reportPaths=target/checkstyle-result.xml + + diff --git a/userdata/sonar-setup.sh b/userdata/sonar-setup.sh new file mode 100644 index 000000000..99a3a78b7 --- /dev/null +++ b/userdata/sonar-setup.sh @@ -0,0 +1,119 @@ +#!/bin/bash +cp /etc/sysctl.conf /root/sysctl.conf_backup +cat < /etc/sysctl.conf +vm.max_map_count=262144 +fs.file-max=65536 +ulimit -n 65536 +ulimit -u 4096 +EOT +cp /etc/security/limits.conf /root/sec_limit.conf_backup +cat < /etc/security/limits.conf +sonarqube - nofile 65536 +sonarqube - nproc 409 +EOT + +sudo apt-get update -y +sudo apt-get install openjdk-11-jdk -y +sudo update-alternatives --config java + +java -version + +sudo apt update +wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add - + +sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' +sudo apt install postgresql postgresql-contrib -y +#sudo -u postgres psql -c "SELECT version();" +sudo systemctl enable postgresql.service +sudo systemctl start postgresql.service +sudo echo "postgres:admin123" | chpasswd +runuser -l postgres -c "createuser sonar" +sudo -i -u postgres psql -c "ALTER USER sonar WITH ENCRYPTED PASSWORD 'admin123';" +sudo -i -u postgres psql -c "CREATE DATABASE sonarqube OWNER sonar;" +sudo -i -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE sonarqube to sonar;" +systemctl restart postgresql +#systemctl status -l postgresql +netstat -tulpena | grep postgres +sudo mkdir -p /sonarqube/ +cd /sonarqube/ +sudo curl -O https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.3.0.34182.zip +sudo apt-get install zip -y +sudo unzip -o sonarqube-8.3.0.34182.zip -d /opt/ +sudo mv /opt/sonarqube-8.3.0.34182/ /opt/sonarqube +sudo groupadd sonar +sudo useradd -c "SonarQube - User" -d /opt/sonarqube/ -g sonar sonar +sudo chown sonar:sonar /opt/sonarqube/ -R +cp /opt/sonarqube/conf/sonar.properties /root/sonar.properties_backup +cat < /opt/sonarqube/conf/sonar.properties +sonar.jdbc.username=sonar +sonar.jdbc.password=admin123 +sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube +sonar.web.host=0.0.0.0 +sonar.web.port=9000 +sonar.web.javaAdditionalOpts=-server +sonar.search.javaOpts=-Xmx512m -Xms512m -XX:+HeapDumpOnOutOfMemoryError +sonar.log.level=INFO +sonar.path.logs=logs +EOT + +cat < /etc/systemd/system/sonarqube.service +[Unit] +Description=SonarQube service +After=syslog.target network.target + +[Service] +Type=forking + +ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start +ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop + +User=sonar +Group=sonar +Restart=always + +LimitNOFILE=65536 +LimitNPROC=4096 + + +[Install] +WantedBy=multi-user.target +EOT + +systemctl daemon-reload +systemctl enable sonarqube.service +#systemctl start sonarqube.service +#systemctl status -l sonarqube.service +apt-get install nginx -y +rm -rf /etc/nginx/sites-enabled/default +rm -rf /etc/nginx/sites-available/default +cat < /etc/nginx/sites-available/sonarqube +server{ + listen 80; + server_name sonarqube.groophy.in; + + access_log /var/log/nginx/sonar.access.log; + error_log /var/log/nginx/sonar.error.log; + + proxy_buffers 16 64k; + proxy_buffer_size 128k; + + location / { + proxy_pass http://127.0.0.1:9000; + proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; + proxy_redirect off; + + proxy_set_header Host \$host; + proxy_set_header X-Real-IP \$remote_addr; + proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto http; + } +} +EOT +ln -s /etc/nginx/sites-available/sonarqube /etc/nginx/sites-enabled/sonarqube +systemctl enable nginx.service +#systemctl restart nginx.service +sudo ufw allow 80,9000,9001/tcp + +echo "System reboot in 30 sec" +sleep 30 +reboot From 1dc4db65f882750c0ba4a7b50d7563e9a75a1b0a Mon Sep 17 00:00:00 2001 From: hkhcoder <137309866+hkhcoder@users.noreply.github.com> Date: Sat, 1 Jul 2023 14:01:42 +0530 Subject: [PATCH 02/64] Update nexus-setup.sh --- userdata/nexus-setup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/userdata/nexus-setup.sh b/userdata/nexus-setup.sh index f3fadecc6..4d0c48fc4 100644 --- a/userdata/nexus-setup.sh +++ b/userdata/nexus-setup.sh @@ -5,10 +5,13 @@ mkdir -p /tmp/nexus/ cd /tmp/nexus/ NEXUSURL="https://download.sonatype.com/nexus/3/latest-unix.tar.gz" wget $NEXUSURL -O nexus.tar.gz +sleep 10 EXTOUT=`tar xzvf nexus.tar.gz` NEXUSDIR=`echo $EXTOUT | cut -d '/' -f1` +sleep 5 rm -rf /tmp/nexus/nexus.tar.gz -rsync -avzh /tmp/nexus/ /opt/nexus/ +cp -r /tmp/nexus/* /opt/nexus/ +sleep 5 useradd nexus chown -R nexus.nexus /opt/nexus cat <> /etc/systemd/system/nexus.service From c757e03a6292fc2ff8a457e59ab482c31dc8ce7b Mon Sep 17 00:00:00 2001 From: hkhcoder <137309866+hkhcoder@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:04:18 +0400 Subject: [PATCH 03/64] Update pom.xml --- pom.xml | 139 ++++++++++++++++++++------------------------------------ 1 file changed, 49 insertions(+), 90 deletions(-) diff --git a/pom.xml b/pom.xml index 03bba333b..b67647827 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 1.8.2.RELEASE 4.3.11.Final 5.2.1.Final - 8.0.32 + 5.1.36 1.4 1.2 4.10 @@ -28,13 +28,13 @@ spring-web ${spring.version} - + org.springframework spring-webmvc ${spring.version} - + org.springframework.security spring-security-web @@ -90,82 +90,36 @@ test - org.mockito - mockito-core - 1.9.5 - test - - - org.springframework - spring-test - 3.2.3.RELEASE - test - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - + org.mockito + mockito-core + 1.9.5 + test + + + org.springframework + spring-test + 3.2.3.RELEASE + test + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + ch.qos.logback logback-classic ${logback.version} - org.hamcrest - hamcrest-all - 1.3 - test - - - commons-fileupload - commons-fileupload - 1.3.1 - - - - net.spy - spymemcached - 2.12.3 - - - commons-io - commons-io - 2.4 - - - - org.springframework.amqp - spring-rabbit - 1.7.1.RELEASE - - - - com.rabbitmq - amqp-client - 4.0.2 - - - - org.elasticsearch - elasticsearch - 5.6.4 - - - - org.elasticsearch.client - transport - 5.6.4 - - - - com.google.code.gson - gson - 2.8.2 + org.hamcrest + hamcrest-all + 1.3 + test - + org.eclipse.jetty @@ -179,7 +133,7 @@ - + org.apache.maven.plugins maven-war-plugin 3.2.2 @@ -188,24 +142,29 @@ org.jacoco jacoco-maven-plugin 0.8.4 - - - jacoco-initialize - process-resources - - prepare-agent - - - - jacoco-site - post-integration-test - - report - - - - - + + + jacoco-initialize + process-resources + + prepare-agent + + + + jacoco-site + post-integration-test + + report + + + + + + + ${NEXUS-GRP-REPO} + http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS-GRP-REPO}/ + + From d98cb9e3134bfbb592b098b5d39294d25b6f9ce7 Mon Sep 17 00:00:00 2001 From: hkhcoder <137309866+hkhcoder@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:04:50 +0400 Subject: [PATCH 04/64] Create settings.xml --- settings.xml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 settings.xml diff --git a/settings.xml b/settings.xml new file mode 100644 index 000000000..eb788f017 --- /dev/null +++ b/settings.xml @@ -0,0 +1,38 @@ + + + + + + ${SNAP-REPO} + ${NEXUS-USER} + ${NEXUS-PASS} + + + ${RELEASE-REPO} + ${NEXUS-USER} + ${NEXUS-PASS} + + + ${CENTRAL-REPO} + ${NEXUS-USER} + ${NEXUS-PASS} + + + ${NEXUS-GRP-REPO} + ${NEXUS-USER} + ${NEXUS-PASS} + + + + + + ${CENTRAL-REPO} + ${CENTRAL-REPO} + http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS-GRP-REPO}/ + * + + + + From 0f8fd84d4485c574035f576740403ec3405d1a87 Mon Sep 17 00:00:00 2001 From: hkhcoder <137309866+hkhcoder@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:31:14 +0400 Subject: [PATCH 05/64] Update pom.xml --- pom.xml | 135 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 91 insertions(+), 44 deletions(-) diff --git a/pom.xml b/pom.xml index b67647827..b9640ea63 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 1.8.2.RELEASE 4.3.11.Final 5.2.1.Final - 5.1.36 + 8.0.22 1.4 1.2 4.10 @@ -28,13 +28,13 @@ spring-web ${spring.version} - + org.springframework spring-webmvc ${spring.version} - + org.springframework.security spring-security-web @@ -90,36 +90,82 @@ test - org.mockito - mockito-core - 1.9.5 - test - - - org.springframework - spring-test - 3.2.3.RELEASE - test - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - + org.mockito + mockito-core + 1.9.5 + test + + + org.springframework + spring-test + 3.2.3.RELEASE + test + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + ch.qos.logback logback-classic ${logback.version} - org.hamcrest - hamcrest-all - 1.3 - test + org.hamcrest + hamcrest-all + 1.3 + test + + + commons-fileupload + commons-fileupload + 1.3.1 + + + + net.spy + spymemcached + 2.12.3 + + + commons-io + commons-io + 2.4 + + + + org.springframework.amqp + spring-rabbit + 1.7.1.RELEASE + + + + com.rabbitmq + amqp-client + 4.0.2 + + + + org.elasticsearch + elasticsearch + 5.6.4 + + + + org.elasticsearch.client + transport + 5.6.4 + + + + com.google.code.gson + gson + 2.8.2 - + org.eclipse.jetty @@ -133,7 +179,7 @@ - + org.apache.maven.plugins maven-war-plugin 3.2.2 @@ -142,29 +188,30 @@ org.jacoco jacoco-maven-plugin 0.8.4 - - - jacoco-initialize - process-resources - - prepare-agent - - - - jacoco-site - post-integration-test - - report - - - - + + + jacoco-initialize + process-resources + + prepare-agent + + + + jacoco-site + post-integration-test + + report + + + + + ${NEXUS-GRP-REPO} - http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS-GRP-REPO}/ + http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS_GRP_REPO}/ From cd1439122336b16de4c89c81a704474975deac76 Mon Sep 17 00:00:00 2001 From: hkhcoder <137309866+hkhcoder@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:31:33 +0400 Subject: [PATCH 06/64] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b9640ea63..9579838c0 100644 --- a/pom.xml +++ b/pom.xml @@ -211,7 +211,7 @@ ${NEXUS-GRP-REPO} - http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS_GRP_REPO}/ + http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS-GRP-REPO}/ From 55e76b9da4e186f112a49aa0322fcdf9c3eca3fd Mon Sep 17 00:00:00 2001 From: hkhcoder <137309866+hkhcoder@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:03:30 +0530 Subject: [PATCH 07/64] Update nexus-setup.sh with jdk17 --- userdata/nexus-setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/userdata/nexus-setup.sh b/userdata/nexus-setup.sh index 4d0c48fc4..b8069b223 100644 --- a/userdata/nexus-setup.sh +++ b/userdata/nexus-setup.sh @@ -1,5 +1,10 @@ #!/bin/bash -yum install java-1.8.0-openjdk.x86_64 wget -y + +sudo rpm --import https://yum.corretto.aws/corretto.key +sudo curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo + +sudo yum install -y java-17-amazon-corretto-devel wget -y + mkdir -p /opt/nexus/ mkdir -p /tmp/nexus/ cd /tmp/nexus/ From 6dde3d2417c4a08121f015c209b3bb2002c64e53 Mon Sep 17 00:00:00 2001 From: hkhcoder <137309866+hkhcoder@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:24:14 +0530 Subject: [PATCH 08/64] Update jenkins-setup.sh --- userdata/jenkins-setup.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/userdata/jenkins-setup.sh b/userdata/jenkins-setup.sh index 7c849fc68..554c539e4 100644 --- a/userdata/jenkins-setup.sh +++ b/userdata/jenkins-setup.sh @@ -1,15 +1,15 @@ #!/bin/bash sudo apt update -sudo apt install openjdk-11-jdk -y -sudo apt install maven wget unzip -y - -curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \ - /usr/share/keyrings/jenkins-keyring.asc > /dev/null - -echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ - https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ - /etc/apt/sources.list.d/jenkins.list > /dev/null - + +sudo apt install openjdk-17-jdk -y + +sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \ +https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key + +echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" \ +https://pkg.jenkins.io/debian-stable binary/ | sudo tee \ +/etc/apt/sources.list.d/jenkins.list > /dev/null + sudo apt-get update + sudo apt-get install jenkins -y -### From 32b4f26ee066f39bdf3d4b9b120eb7d91a2bf1c9 Mon Sep 17 00:00:00 2001 From: hkhcoder <137309866+hkhcoder@users.noreply.github.com> Date: Wed, 5 Mar 2025 19:57:41 +0530 Subject: [PATCH 09/64] Update nexus-setup.sh --- userdata/nexus-setup.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/userdata/nexus-setup.sh b/userdata/nexus-setup.sh index b8069b223..c6477971f 100644 --- a/userdata/nexus-setup.sh +++ b/userdata/nexus-setup.sh @@ -5,10 +5,10 @@ sudo curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto sudo yum install -y java-17-amazon-corretto-devel wget -y -mkdir -p /opt/nexus/ -mkdir -p /tmp/nexus/ +mkdir -p /opt/nexus/ +mkdir -p /tmp/nexus/ cd /tmp/nexus/ -NEXUSURL="https://download.sonatype.com/nexus/3/latest-unix.tar.gz" +NEXUSURL="https://download.sonatype.com/nexus/3/nexus-unix-x86-64-3.78.0-14.tar.gz" wget $NEXUSURL -O nexus.tar.gz sleep 10 EXTOUT=`tar xzvf nexus.tar.gz` @@ -18,22 +18,22 @@ rm -rf /tmp/nexus/nexus.tar.gz cp -r /tmp/nexus/* /opt/nexus/ sleep 5 useradd nexus -chown -R nexus.nexus /opt/nexus +chown -R nexus.nexus /opt/nexus cat <> /etc/systemd/system/nexus.service -[Unit] -Description=nexus service -After=network.target - -[Service] -Type=forking -LimitNOFILE=65536 -ExecStart=/opt/nexus/$NEXUSDIR/bin/nexus start -ExecStop=/opt/nexus/$NEXUSDIR/bin/nexus stop -User=nexus -Restart=on-abort - -[Install] -WantedBy=multi-user.target +[Unit] +Description=nexus service +After=network.target + +[Service] +Type=forking +LimitNOFILE=65536 +ExecStart=/opt/nexus/$NEXUSDIR/bin/nexus start +ExecStop=/opt/nexus/$NEXUSDIR/bin/nexus stop +User=nexus +Restart=on-abort + +[Install] +WantedBy=multi-user.target EOT From e17176244553aa2525ab07346dc8ce880648dbe2 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 11:51:42 +0000 Subject: [PATCH 10/64] empty --- Jenkinsfile | 121 ---------------------------------------------------- 1 file changed, 121 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 969d00c6e..e69de29bb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,121 +0,0 @@ -pipeline { - - agent any -/* - tools { - maven "maven3" - } -*/ - environment { - NEXUS_VERSION = "nexus3" - NEXUS_PROTOCOL = "http" - NEXUS_URL = "172.31.40.209:8081" - NEXUS_REPOSITORY = "vprofile-release" - NEXUS_REPOGRP_ID = "vprofile-grp-repo" - NEXUS_CREDENTIAL_ID = "nexuslogin" - ARTVERSION = "${env.BUILD_ID}" - } - - stages{ - - stage('BUILD'){ - steps { - sh 'mvn clean install -DskipTests' - } - post { - success { - echo 'Now Archiving...' - archiveArtifacts artifacts: '**/target/*.war' - } - } - } - - stage('UNIT TEST'){ - steps { - sh 'mvn test' - } - } - - stage('INTEGRATION TEST'){ - steps { - sh 'mvn verify -DskipUnitTests' - } - } - - stage ('CODE ANALYSIS WITH CHECKSTYLE'){ - steps { - sh 'mvn checkstyle:checkstyle' - } - post { - success { - echo 'Generated Analysis Result' - } - } - } - - stage('CODE ANALYSIS with SONARQUBE') { - - environment { - scannerHome = tool 'sonarscanner4' - } - - steps { - withSonarQubeEnv('sonar-pro') { - sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ - -Dsonar.projectName=vprofile-repo \ - -Dsonar.projectVersion=1.0 \ - -Dsonar.sources=src/ \ - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ - -Dsonar.junit.reportsPath=target/surefire-reports/ \ - -Dsonar.jacoco.reportsPath=target/jacoco.exec \ - -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' - } - - timeout(time: 10, unit: 'MINUTES') { - waitForQualityGate abortPipeline: true - } - } - } - - stage("Publish to Nexus Repository Manager") { - steps { - script { - pom = readMavenPom file: "pom.xml"; - filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); - echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" - artifactPath = filesByGlob[0].path; - artifactExists = fileExists artifactPath; - if(artifactExists) { - echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version} ARTVERSION"; - nexusArtifactUploader( - nexusVersion: NEXUS_VERSION, - protocol: NEXUS_PROTOCOL, - nexusUrl: NEXUS_URL, - groupId: NEXUS_REPOGRP_ID, - version: ARTVERSION, - repository: NEXUS_REPOSITORY, - credentialsId: NEXUS_CREDENTIAL_ID, - artifacts: [ - [artifactId: pom.artifactId, - classifier: '', - file: artifactPath, - type: pom.packaging], - [artifactId: pom.artifactId, - classifier: '', - file: "pom.xml", - type: "pom"] - ] - ); - } - else { - error "*** File: ${artifactPath}, could not be found"; - } - } - } - } - - - } - - -} From da1186c3af5904a58c4f064547b87c3b16e46503 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 12:35:13 +0000 Subject: [PATCH 11/64] updated --- Jenkinsfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e69de29bb..2a06e415b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -0,0 +1,33 @@ +pipeline { + agent any + tools { + maven "Maven3.9" + jdk "JDK17" + } + + environment { + SNAP_REPO = 'vprofile-snapshot' + NEXUS_USER = 'admin' + NEXUS_PASS = 'Myworld@1997@' + RELEASE_REPO = 'vprofile-release' + RELEASE_REPO = 'vprofile-release' + NEXUSIP = '172.31.6.37' + NEXUSPORT = '8081' + NEXUS_GRP_REPO = 'vpro-maven-group' + NEXUS_LOGIN ="Nexuslogin" + + + } + + stages { + stage('Build'){ + steps { + sh 'mvn -s settings.xml -DskipTests install' + } + } + } + + + + +} \ No newline at end of file From 014520d87516b9b3dacdbb3b6af3e2b29717e194 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 12:43:01 +0000 Subject: [PATCH 12/64] update --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2a06e415b..3f96bbce0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { NEXUS_USER = 'admin' NEXUS_PASS = 'Myworld@1997@' RELEASE_REPO = 'vprofile-release' - RELEASE_REPO = 'vprofile-release' + CENTRAL_REPO = 'vpro-maven-central' NEXUSIP = '172.31.6.37' NEXUSPORT = '8081' NEXUS_GRP_REPO = 'vpro-maven-group' From b866059395efffa999525bbe0ba50598ad6aa8d1 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 12:48:33 +0000 Subject: [PATCH 13/64] test --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f96bbce0..c59a67917 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,7 +22,8 @@ pipeline { stages { stage('Build'){ steps { - sh 'mvn -s settings.xml -DskipTests install' + sh 'mvn install' + } } } From a2542a6332c5556b74392fe646677bf2be76011b Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:03:51 +0000 Subject: [PATCH 14/64] up --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c59a67917..a106e26de 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,8 +21,8 @@ pipeline { stages { stage('Build'){ - steps { - sh 'mvn install' + steps{ + sh 'mvn -s settings.xml -DskipTests install' } } From bc509af2b4c3959604333e44046c20f324060075 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:10:04 +0000 Subject: [PATCH 15/64] jenkiensfile-updated --- Jenkinsfile | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a106e26de..9a2d01fd2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,34 +1,27 @@ pipeline { - agent any - tools { - maven "Maven3.9" - jdk "JDK17" - } - - environment { - SNAP_REPO = 'vprofile-snapshot' - NEXUS_USER = 'admin' - NEXUS_PASS = 'Myworld@1997@' - RELEASE_REPO = 'vprofile-release' - CENTRAL_REPO = 'vpro-maven-central' - NEXUSIP = '172.31.6.37' - NEXUSPORT = '8081' - NEXUS_GRP_REPO = 'vpro-maven-group' - NEXUS_LOGIN ="Nexuslogin" - - + agent any + tools { + maven "MAVEN3.9" + jdk "JDK17" + } + + environment { + SNAP_REPO = 'vprofile-snapshot' + NEXUS_USER = 'admin' + NEXUS_PASS = 'Myworld@1997@' + RELEASE_REPO = 'vprofile-release' + CENTRAL_REPO = 'vpro-maven-central' + NEXUSIP = '172.31.6.37' + NEXUSPORT = '8081' + NEXUS_GRP_REPO = 'vpro-maven-group' + NEXUS_LOGIN = 'Nexuslogin' } - stages { - stage('Build'){ - steps{ + stages { + stage('Build'){ + steps { sh 'mvn -s settings.xml -DskipTests install' - + } } - } - } - - - - + } } \ No newline at end of file From 4a362cfa64a8228f62eac04d9c9348ff24913578 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:12:58 +0000 Subject: [PATCH 16/64] maven --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9a2d01fd2..e94cfaad0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent any tools { - maven "MAVEN3.9" + maven "Maven3.9" jdk "JDK17" } From e5ad2e116627cb3cb39bf4c9cb876b8302acd13d Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:15:51 +0000 Subject: [PATCH 17/64] maven --- Jenkinsfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e94cfaad0..b0d11c5fe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,12 @@ pipeline { stages { stage('Build'){ steps { + sh ''' + sed -i "s|\\$\\{NEXUS-GRP-REPO\\}|$NEXUS_GRP_REPO|g" settings.xml + sed -i "s|\\$\\{CENTRAL-REPO\\}|central|g" settings.xml + sed -i "s|\\$\\{NEXUSIP\\}|$NEXUSIP|g" settings.xml + sed -i "s|\\$\\{NEXUSPORT\\}|$NEXUSPORT|g" settings.xml + ''' sh 'mvn -s settings.xml -DskipTests install' } } From 924312ac230cd973648a54990997e6d80a076312 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:18:00 +0000 Subject: [PATCH 18/64] updated --- Jenkinsfile | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b0d11c5fe..cdb434f0c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,30 +4,34 @@ pipeline { maven "Maven3.9" jdk "JDK17" } - + environment { - SNAP_REPO = 'vprofile-snapshot' - NEXUS_USER = 'admin' - NEXUS_PASS = 'Myworld@1997@' - RELEASE_REPO = 'vprofile-release' - CENTRAL_REPO = 'vpro-maven-central' - NEXUSIP = '172.31.6.37' - NEXUSPORT = '8081' - NEXUS_GRP_REPO = 'vpro-maven-group' - NEXUS_LOGIN = 'Nexuslogin' + SNAP_REPO = 'vprofile-snapshot' + NEXUS_USER = 'admin' + NEXUS_PASS = 'Myworld@1997@' + RELEASE_REPO = 'vprofile-release' + CENTRAL_REPO = 'vpro-maven-central' + NEXUSIP = '172.31.6.37' + NEXUSPORT = '8081' + NEXUS_GRP_REPO = 'vpro-maven-group' + NEXUS_LOGIN = 'Nexuslogin' } stages { - stage('Build'){ + stage('Build') { steps { sh ''' - sed -i "s|\\$\\{NEXUS-GRP-REPO\\}|$NEXUS_GRP_REPO|g" settings.xml - sed -i "s|\\$\\{CENTRAL-REPO\\}|central|g" settings.xml - sed -i "s|\\$\\{NEXUSIP\\}|$NEXUSIP|g" settings.xml - sed -i "s|\\$\\{NEXUSPORT\\}|$NEXUSPORT|g" settings.xml + sed -i "s|\\$\\{NEXUS_GRP_REPO\\}|$NEXUS_GRP_REPO|g" settings.xml + sed -i "s|\\$\\{CENTRAL_REPO\\}|$CENTRAL_REPO|g" settings.xml + sed -i "s|\\$\\{NEXUSIP\\}|$NEXUSIP|g" settings.xml + sed -i "s|\\$\\{NEXUSPORT\\}|$NEXUSPORT|g" settings.xml + sed -i "s|\\$\\{NEXUS_USER\\}|$NEXUS_USER|g" settings.xml + sed -i "s|\\$\\{NEXUS_PASS\\}|$NEXUS_PASS|g" settings.xml + sed -i "s|\\$\\{SNAP_REPO\\}|$SNAP_REPO|g" settings.xml + sed -i "s|\\$\\{RELEASE_REPO\\}|$RELEASE_REPO|g" settings.xml + mvn -s settings.xml -DskipTests install ''' - sh 'mvn -s settings.xml -DskipTests install' } } } -} \ No newline at end of file +} From 440dece7221903e3cb989dd363b180ec54a55341 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:21:13 +0000 Subject: [PATCH 19/64] Jenkines --- Jenkinsfile | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cdb434f0c..8ff008f52 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,34 +1,36 @@ pipeline { agent any + tools { maven "Maven3.9" jdk "JDK17" } environment { - SNAP_REPO = 'vprofile-snapshot' - NEXUS_USER = 'admin' - NEXUS_PASS = 'Myworld@1997@' - RELEASE_REPO = 'vprofile-release' - CENTRAL_REPO = 'vpro-maven-central' - NEXUSIP = '172.31.6.37' - NEXUSPORT = '8081' + SNAP_REPO = 'vprofile-snapshot' + NEXUS_USER = 'admin' + NEXUS_PASS = 'Myworld@1997@' + RELEASE_REPO = 'vprofile-release' + CENTRAL_REPO = 'vpro-maven-central' + NEXUSIP = '172.31.5.4' + NEXUSPORT = '8081' NEXUS_GRP_REPO = 'vpro-maven-group' - NEXUS_LOGIN = 'Nexuslogin' + NEXUS_LOGIN = 'nexuslogin' } stages { stage('Build') { steps { sh ''' - sed -i "s|\\$\\{NEXUS_GRP_REPO\\}|$NEXUS_GRP_REPO|g" settings.xml - sed -i "s|\\$\\{CENTRAL_REPO\\}|$CENTRAL_REPO|g" settings.xml - sed -i "s|\\$\\{NEXUSIP\\}|$NEXUSIP|g" settings.xml - sed -i "s|\\$\\{NEXUSPORT\\}|$NEXUSPORT|g" settings.xml - sed -i "s|\\$\\{NEXUS_USER\\}|$NEXUS_USER|g" settings.xml - sed -i "s|\\$\\{NEXUS_PASS\\}|$NEXUS_PASS|g" settings.xml - sed -i "s|\\$\\{SNAP_REPO\\}|$SNAP_REPO|g" settings.xml - sed -i "s|\\$\\{RELEASE_REPO\\}|$RELEASE_REPO|g" settings.xml + sed -i 's|\\${NEXUS_GRP_REPO}|'"$NEXUS_GRP_REPO"'|g' settings.xml + sed -i 's|\\${CENTRAL_REPO}|'"$CENTRAL_REPO"'|g' settings.xml + sed -i 's|\\${NEXUSIP}|'"$NEXUSIP"'|g' settings.xml + sed -i 's|\\${NEXUSPORT}|'"$NEXUSPORT"'|g' settings.xml + sed -i 's|\\${NEXUS_USER}|'"$NEXUS_USER"'|g' settings.xml + sed -i 's|\\${NEXUS_PASS}|'"$NEXUS_PASS"'|g' settings.xml + sed -i 's|\\${SNAP_REPO}|'"$SNAP_REPO"'|g' settings.xml + sed -i 's|\\${RELEASE_REPO}|'"$RELEASE_REPO"'|g' settings.xml + mvn -s settings.xml -DskipTests install ''' } From 5176ce593d83b2177c2e17680d8f7ce284243762 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:22:01 +0000 Subject: [PATCH 20/64] new --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8ff008f52..7b77c5b36 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { NEXUS_PASS = 'Myworld@1997@' RELEASE_REPO = 'vprofile-release' CENTRAL_REPO = 'vpro-maven-central' - NEXUSIP = '172.31.5.4' + NEXUSIP = '54.219.137.94' NEXUSPORT = '8081' NEXUS_GRP_REPO = 'vpro-maven-group' NEXUS_LOGIN = 'nexuslogin' From 547ab65de149529ac709edb6f55d7d0f25f26cb4 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:23:14 +0000 Subject: [PATCH 21/64] c --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7b77c5b36..fd25133c0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { NEXUS_PASS = 'Myworld@1997@' RELEASE_REPO = 'vprofile-release' CENTRAL_REPO = 'vpro-maven-central' - NEXUSIP = '54.219.137.94' + NEXUSIP = '172.31.6.37' NEXUSPORT = '8081' NEXUS_GRP_REPO = 'vpro-maven-group' NEXUS_LOGIN = 'nexuslogin' From 9c621c4a8f79533218c35169b654b136bb4fbbf0 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:26:16 +0000 Subject: [PATCH 22/64] chejc --- Jenkinsfile | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd25133c0..71a9599c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,39 +1,27 @@ pipeline { agent any - tools { maven "Maven3.9" jdk "JDK17" } - + environment { SNAP_REPO = 'vprofile-snapshot' - NEXUS_USER = 'admin' - NEXUS_PASS = 'Myworld@1997@' - RELEASE_REPO = 'vprofile-release' - CENTRAL_REPO = 'vpro-maven-central' - NEXUSIP = '172.31.6.37' - NEXUSPORT = '8081' - NEXUS_GRP_REPO = 'vpro-maven-group' - NEXUS_LOGIN = 'nexuslogin' + NEXUS_USER = 'admin' + NEXUS_PASS = 'Myworld@1997@' + RELEASE_REPO = 'vprofile-release' + CENTRAL_REPO = 'vpro-maven-central' + NEXUSIP = '172.31.6.37' + NEXUSPORT = '8081' + NEXUS_GRP_REPO = 'vpro-maven-group' + NEXUS_LOGIN = 'Nexuslogin' } stages { - stage('Build') { + stage('Build'){ steps { - sh ''' - sed -i 's|\\${NEXUS_GRP_REPO}|'"$NEXUS_GRP_REPO"'|g' settings.xml - sed -i 's|\\${CENTRAL_REPO}|'"$CENTRAL_REPO"'|g' settings.xml - sed -i 's|\\${NEXUSIP}|'"$NEXUSIP"'|g' settings.xml - sed -i 's|\\${NEXUSPORT}|'"$NEXUSPORT"'|g' settings.xml - sed -i 's|\\${NEXUS_USER}|'"$NEXUS_USER"'|g' settings.xml - sed -i 's|\\${NEXUS_PASS}|'"$NEXUS_PASS"'|g' settings.xml - sed -i 's|\\${SNAP_REPO}|'"$SNAP_REPO"'|g' settings.xml - sed -i 's|\\${RELEASE_REPO}|'"$RELEASE_REPO"'|g' settings.xml - - mvn -s settings.xml -DskipTests install - ''' + sh 'mvn install' } } } -} +} \ No newline at end of file From 7da3e9888481336b06c07c5d98f8da81a3d8cdf0 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:29:29 +0000 Subject: [PATCH 23/64] check --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 71a9599c6..e94cfaad0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { stages { stage('Build'){ steps { - sh 'mvn install' + sh 'mvn -s settings.xml -DskipTests install' } } } From 86c51a63881ee21cc241954dd83f77501f1afc9b Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Fri, 18 Apr 2025 13:32:17 +0000 Subject: [PATCH 24/64] server --- settings.xml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/settings.xml b/settings.xml index eb788f017..82588be9c 100644 --- a/settings.xml +++ b/settings.xml @@ -5,32 +5,32 @@ - ${SNAP-REPO} - ${NEXUS-USER} - ${NEXUS-PASS} + ${SNAP_REPO} + ${NEXUS_USER} + ${NEXUS_PASS} - ${RELEASE-REPO} - ${NEXUS-USER} - ${NEXUS-PASS} + ${RELEASE_REPO} + ${NEXUS_USER} + ${NEXUS_PASS} - - ${CENTRAL-REPO} - ${NEXUS-USER} - ${NEXUS-PASS} + + ${CENTRAL_REPO} + ${NEXUS_USER} + ${NEXUS_PASS} - ${NEXUS-GRP-REPO} - ${NEXUS-USER} - ${NEXUS-PASS} + ${NEXUS_GRP_REPO} + ${NEXUS_USER} + ${NEXUS_PASS} - ${CENTRAL-REPO} - ${CENTRAL-REPO} - http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS-GRP-REPO}/ + ${CENTRAL_REPO} + ${CENTRAL_REPO} + http://${NEXUSIP}:${NEXUSPORT}/repository/${NEXUS_GRP_REPO}/ * From f25a1e83b262b345e9bcfa58cd33a5d52cc868b0 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 10:25:23 +0000 Subject: [PATCH 25/64] webhook_impletetion --- Jenkinsfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index e94cfaad0..df1ca6971 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,6 +22,34 @@ pipeline { steps { sh 'mvn -s settings.xml -DskipTests install' } + post { + success { + + echo "Now Archiving." + archiveArtifacts artifacts: '**/*.war' + } + + } + } + stage('Test'){ + steps { + + sh 'mvn -s settings.xml test' + echo "Testing" + + } + } + stages('Checkstyle Analysis'){ + + steps { + + sh 'mvn -s settings.xml checkstyle:checkstyle' + + } + } + } + + } \ No newline at end of file From a7f67d7df956d12c5456d408889719dae0a7037c Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 10:28:22 +0000 Subject: [PATCH 26/64] webhook --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index df1ca6971..cd230c95f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,6 +45,7 @@ pipeline { steps { sh 'mvn -s settings.xml checkstyle:checkstyle' + echo "done" } } From 146f872cf1640e9370a80acfa15b6a60df7a2e3d Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 10:30:38 +0000 Subject: [PATCH 27/64] new --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cd230c95f..3c1e63f72 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,7 +40,7 @@ pipeline { } } - stages('Checkstyle Analysis'){ + stage('Checkstyle Analysis'){ steps { From 8aede0b9bf0b819763a2e4b3f324758f49b050f0 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 10:33:13 +0000 Subject: [PATCH 28/64] se --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3c1e63f72..224e65db0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,14 +38,14 @@ pipeline { echo "Testing" } - +s } stage('Checkstyle Analysis'){ steps { sh 'mvn -s settings.xml checkstyle:checkstyle' - echo "done" + echo "done1" } } From ea4d91f030316f377c3dd052b52ca6a55834f274 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 10:37:59 +0000 Subject: [PATCH 29/64] checkingwebhook --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 224e65db0..2af68fbe0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ s steps { sh 'mvn -s settings.xml checkstyle:checkstyle' - echo "done1" + } } From 285af6c8e8fc03b25f7a24d7a49d579a71729b4d Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 10:38:58 +0000 Subject: [PATCH 30/64] webhook --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2af68fbe0..0f6aced93 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ pipeline { echo "Testing" } -s + } stage('Checkstyle Analysis'){ From 9637555b3f8302e006e5d09dfa0589613572236d Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 10:59:42 +0000 Subject: [PATCH 31/64] updated --- Jenkinsfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 0f6aced93..00e52dd3c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,6 +15,9 @@ pipeline { NEXUSPORT = '8081' NEXUS_GRP_REPO = 'vpro-maven-group' NEXUS_LOGIN = 'Nexuslogin' + SONARSERVER = 'sonarserver' + SONARSCANNER = 'sonarscanner' + } stages { @@ -49,6 +52,25 @@ pipeline { } } + stage('Sonar Analysis'){ + + environment { + scannerHome = tool "${SONARSCANNER}" + } + + steps{ + + withSonarQubeEnv("${SONARSERVER}") { + sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ + -Dsonar.projectName=vprofile \ + -Dsonar.projectVersion=1.0 \ + -Dsonar.sources=src/ \ + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ + -Dsonar.junit.reportsPath=target/surefire-reports/ \ + -Dsonar.jacoco.reportsPath=target/jacoco.exec \ + -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' + } + } } From 65e7f34821e4f464a49ca003c5d692d7567e7ec5 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:01:18 +0000 Subject: [PATCH 32/64] } --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 00e52dd3c..b114ef016 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,6 +71,7 @@ pipeline { -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' } } + } } From eb9567334882ad0a80e7a2cebdecdbf8fc1802cb Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:04:16 +0000 Subject: [PATCH 33/64] all updated --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b114ef016..9d38dd586 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -69,9 +69,9 @@ pipeline { -Dsonar.junit.reportsPath=target/surefire-reports/ \ -Dsonar.jacoco.reportsPath=target/jacoco.exec \ -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' + } } } - } } From 4040aabfbcd9f6feb04d78f26f395a97b1ba5de6 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:09:30 +0000 Subject: [PATCH 34/64] newversion --- Jenkinsfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9d38dd586..a7cd38a99 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,14 +61,15 @@ pipeline { steps{ withSonarQubeEnv("${SONARSERVER}") { - sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ - -Dsonar.projectName=vprofile \ - -Dsonar.projectVersion=1.0 \ - -Dsonar.sources=src/ \ - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ - -Dsonar.junit.reportsPath=target/surefire-reports/ \ - -Dsonar.jacoco.reportsPath=target/jacoco.exec \ - -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' + sh '''${scannerHome}/bin/sonar-scanner \ + -Dsonar.projectKey=vprofile \ + -Dsonar.projectName=vprofile \ + -Dsonar.projectVersion=1.0 \ + -Dsonar.sources=src/ \ + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ + -Dsonar.junit.reportsPath=target/surefire-reports/ \ + -Dsonar.jacoco.reportsPath=target/jacoco.exec \ + -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' } } } From 542e3d46b363d88ced75b16ca2eb16a76bd8941f Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:11:08 +0000 Subject: [PATCH 35/64] full --- Jenkinsfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a7cd38a99..9d38dd586 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,15 +61,14 @@ pipeline { steps{ withSonarQubeEnv("${SONARSERVER}") { - sh '''${scannerHome}/bin/sonar-scanner \ - -Dsonar.projectKey=vprofile \ - -Dsonar.projectName=vprofile \ - -Dsonar.projectVersion=1.0 \ - -Dsonar.sources=src/ \ - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ - -Dsonar.junit.reportsPath=target/surefire-reports/ \ - -Dsonar.jacoco.reportsPath=target/jacoco.exec \ - -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' + sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ + -Dsonar.projectName=vprofile \ + -Dsonar.projectVersion=1.0 \ + -Dsonar.sources=src/ \ + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ + -Dsonar.junit.reportsPath=target/surefire-reports/ \ + -Dsonar.jacoco.reportsPath=target/jacoco.exec \ + -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' } } } From 15aec45203f058bd4c191035152904796fdf58fc Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:16:13 +0000 Subject: [PATCH 36/64] JAVA --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9d38dd586..0a8fb16c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any tools { maven "Maven3.9" - jdk "JDK17" + jdk "JDK21" } environment { From 85ac14edb1d12ee4b29ccedd924baacf158c2315 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:23:56 +0000 Subject: [PATCH 37/64] c --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 0a8fb16c8..3db3e3a42 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,6 +53,9 @@ pipeline { } } stage('Sonar Analysis'){ + tools { + jdk "JDK11" + } environment { scannerHome = tool "${SONARSCANNER}" From 46a18dd43779d402efcb4c8075308de9bad96230 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:26:58 +0000 Subject: [PATCH 38/64] checking --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3db3e3a42..0a2dcf386 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,7 +65,7 @@ pipeline { withSonarQubeEnv("${SONARSERVER}") { sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ - -Dsonar.projectName=vprofile \ + -Dsonar.projectName=vprofile1 \ -Dsonar.projectVersion=1.0 \ -Dsonar.sources=src/ \ -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ From 056685813bfa63ad1126bfc3ca12fed6f7fd5397 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:33:40 +0000 Subject: [PATCH 39/64] Quality Gate --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 0a2dcf386..5624d8009 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,6 +75,15 @@ pipeline { } } } + stage('Quality Gate'){ + steps{ + timeout(time: 1, unit: 'HOURS') { + // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails + // true = set pipeline to UNSTABLE, false = don't + waitForQualityGate abortPipeline: true + } + } + } } From 59060758e56cf0d5a32cead7b83ac256a5caf63d Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 11:49:22 +0000 Subject: [PATCH 40/64] tets --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5624d8009..77b801fe0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,6 +24,7 @@ pipeline { stage('Build'){ steps { sh 'mvn -s settings.xml -DskipTests install' + echo } post { success { From 9dfddc16b3730a6ebf18c1f141315d2b379268b9 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 12:08:54 +0000 Subject: [PATCH 41/64] art --- Jenkinsfile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 77b801fe0..34933aacf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ pipeline { stage('Build'){ steps { sh 'mvn -s settings.xml -DskipTests install' - echo + } post { success { @@ -82,9 +82,29 @@ pipeline { // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails // true = set pipeline to UNSTABLE, false = don't waitForQualityGate abortPipeline: true + echo "wauting" } } } + stage('UploadArtifact"'){ + steps{ + nexusArtifactUploader( + nexusVersion: 'nexus3', + protocol: 'http', + nexusUrl: "${NEXUSIP}:${NEXUSPORT}", + groupId: 'QA', + version: "${env.BUILD_ID}-${env.BUILD_TIMESTAMP}", + repository: "${RELEASE_REPO}", + credentialsId: "${NEXUS_LOGIN}", + artifacts: [ + [artifactId: 'vproapp', + classifier: '', + file: 'target/vprofile-v2.war', + type: 'war'] + ] + ) + } + } } From a6cc633766bc99d99b2f97a99a21c6c37a888a46 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 16:36:24 +0000 Subject: [PATCH 42/64] now --- Jenkinsfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 34933aacf..6e8829271 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,8 @@ +def COLOR_MAP = [ + 'SUCCESS': 'good', + 'FAILURE': 'danger', +] + pipeline { agent any tools { @@ -39,7 +44,7 @@ pipeline { steps { sh 'mvn -s settings.xml test' - echo "Testing" + echo "Testing1" } @@ -107,6 +112,14 @@ pipeline { } } + post { + always { + echo 'Slack Notifications.' + slackSend channel: '#jenkinscicd', + color: COLOR_MAP[currentBuild.currentResult], + message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info at: ${env.BUILD_URL}" + } + } } \ No newline at end of file From 268d34afc58a6285188c5b8a26af466b0d09f177 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 16:37:38 +0000 Subject: [PATCH 43/64] now --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6e8829271..080c159d4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,7 +115,7 @@ pipeline { post { always { echo 'Slack Notifications.' - slackSend channel: '#jenkinscicd', + slackSend channel: '#pipeline', color: COLOR_MAP[currentBuild.currentResult], message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info at: ${env.BUILD_URL}" } From 7aad7e0a65687f1bc05653a7c25c7b9d3c183690 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 17:31:14 +0000 Subject: [PATCH 44/64] jenkinscicd --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 080c159d4..6e8829271 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,7 +115,7 @@ pipeline { post { always { echo 'Slack Notifications.' - slackSend channel: '#pipeline', + slackSend channel: '#jenkinscicd', color: COLOR_MAP[currentBuild.currentResult], message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info at: ${env.BUILD_URL}" } From 80e6141e353afc6c3c6a091be5a0c7e81521ded5 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sat, 19 Apr 2025 17:34:26 +0000 Subject: [PATCH 45/64] jenkinscicd --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6e8829271..ed1c6f930 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -87,7 +87,7 @@ pipeline { // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails // true = set pipeline to UNSTABLE, false = don't waitForQualityGate abortPipeline: true - echo "wauting" + echo "wauting1" } } } From dfa3fa02af9de2d6fa39109e61080eb5c116e138 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 14:47:05 +0000 Subject: [PATCH 46/64] check --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index ed1c6f930..d7b3f9079 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,4 @@ + def COLOR_MAP = [ 'SUCCESS': 'good', 'FAILURE': 'danger', @@ -118,6 +119,8 @@ pipeline { slackSend channel: '#jenkinscicd', color: COLOR_MAP[currentBuild.currentResult], message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info at: ${env.BUILD_URL}" + + } } From f0c45207bd6941135545e52b179e9a53bd99049b Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 14:55:21 +0000 Subject: [PATCH 47/64] cici-jenkines --- Docker-files/app/Dockerfile | 11 ++ Docker-files/app/multistage/Dockerfile | 12 +++ Docker-files/d.txt | 0 Docker-files/db/Dockerfile | 9 ++ Docker-files/db/db_backup.sql | 133 ++++++++++++++++++++++++ Docker-files/web/Dockerfile | 6 ++ Docker-files/web/nginvproapp.conf | 9 ++ Jenkinsfile => ProdPipeline/Jenkinsfile | 0 StagePipeline/Jenkinsfile | 128 +++++++++++++++++++++++ 9 files changed, 308 insertions(+) create mode 100644 Docker-files/app/Dockerfile create mode 100644 Docker-files/app/multistage/Dockerfile create mode 100644 Docker-files/d.txt create mode 100644 Docker-files/db/Dockerfile create mode 100644 Docker-files/db/db_backup.sql create mode 100644 Docker-files/web/Dockerfile create mode 100644 Docker-files/web/nginvproapp.conf rename Jenkinsfile => ProdPipeline/Jenkinsfile (100%) create mode 100644 StagePipeline/Jenkinsfile diff --git a/Docker-files/app/Dockerfile b/Docker-files/app/Dockerfile new file mode 100644 index 000000000..82271e37a --- /dev/null +++ b/Docker-files/app/Dockerfile @@ -0,0 +1,11 @@ +FROM tomcat:10-jdk21 +LABEL "Project"="Vprofile" +LABEL "Author"="Imran" + +RUN rm -rf /usr/local/tomcat/webapps/* +COPY target/vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war + +EXPOSE 8080 +CMD ["catalina.sh", "run"] +WORKDIR /usr/local/tomcat/ +VOLUME /usr/local/tomcat/webapps diff --git a/Docker-files/app/multistage/Dockerfile b/Docker-files/app/multistage/Dockerfile new file mode 100644 index 000000000..c1b3ec3be --- /dev/null +++ b/Docker-files/app/multistage/Dockerfile @@ -0,0 +1,12 @@ +FROM maven:3.9.9-eclipse-temurin-21-jammy AS BUILD_IMAGE +RUN git clone https://github.com/hkhcoder/vprofile-project.git +RUN cd vprofile-project && git checkout docker && mvn install + +FROM tomcat:10-jdk21 + +RUN rm -rf /usr/local/tomcat/webapps/* + +COPY --from=BUILD_IMAGE vprofile-project/target/vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war + +EXPOSE 8080 +CMD ["catalina.sh", "run"] diff --git a/Docker-files/d.txt b/Docker-files/d.txt new file mode 100644 index 000000000..e69de29bb diff --git a/Docker-files/db/Dockerfile b/Docker-files/db/Dockerfile new file mode 100644 index 000000000..120a5b8cd --- /dev/null +++ b/Docker-files/db/Dockerfile @@ -0,0 +1,9 @@ +FROM mysql:8.0.33 +LABEL "Project"="Vprofile" +LABEL "Author"="Imran" + +ENV MYSQL_ROOT_PASSWORD="vprodbpass" +ENV MYSQL_DATABASE="accounts" + + +ADD db_backup.sql docker-entrypoint-initdb.d/db_backup.sql diff --git a/Docker-files/db/db_backup.sql b/Docker-files/db/db_backup.sql new file mode 100644 index 000000000..2f17a4df3 --- /dev/null +++ b/Docker-files/db/db_backup.sql @@ -0,0 +1,133 @@ +-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) +-- +-- Host: localhost Database: accounts +-- ------------------------------------------------------ +-- Server version 5.7.18-0ubuntu0.16.10.1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `role` +-- + +DROP TABLE IF EXISTS `role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `role` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `role` +-- + +LOCK TABLES `role` WRITE; +/*!40000 ALTER TABLE `role` DISABLE KEYS */; +INSERT INTO `role` VALUES (1,'ROLE_USER'); +/*!40000 ALTER TABLE `role` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `user` +-- + +DROP TABLE IF EXISTS `user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `username` varchar(255) DEFAULT NULL, + `userEmail` varchar(255) DEFAULT NULL, + `profileImg` varchar(255) DEFAULT NULL, + `profileImgPath` varchar(255) DEFAULT NULL, + `dateOfBirth` varchar(255) DEFAULT NULL, + `fatherName` varchar(255) DEFAULT NULL, + `motherName` varchar(255) DEFAULT NULL, + `gender` varchar(255) DEFAULT NULL, + `maritalStatus` varchar(255) DEFAULT NULL, + `permanentAddress` varchar(255) DEFAULT NULL, + `tempAddress` varchar(255) DEFAULT NULL, + `primaryOccupation` varchar(255) DEFAULT NULL, + `secondaryOccupation` varchar(255) DEFAULT NULL, + `skills` varchar(255) DEFAULT NULL, + `phoneNumber` varchar(255) DEFAULT NULL, + `secondaryPhoneNumber` varchar(255) DEFAULT NULL, + `nationality` varchar(255) DEFAULT NULL, + `language` varchar(255) DEFAULT NULL, + `workingExperience` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `user` +-- + +LOCK TABLES `user` WRITE; +/*!40000 ALTER TABLE `user` DISABLE KEYS */; + +INSERT INTO `user` VALUES (7,'admin_vp','admin@hkhinfo.com',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'$2a$11$0a7VdTr4rfCQqtsvpng6GuJnzUmQ7gZiHXgzGPgm5hkRa3avXgBLK') +,(8,'Abrar Nirban','abrar.nirban74@gmail.com',NULL,NULL,'27/01/2002','A nirban','T nirban','male','unMarried','Dubai,UAE','Dubai,UAE','Software Engineer','Software Engineer','Java HTML CSS ','8888888888','8888888888','Indian','english','2 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6JAW'), +(9,'Amayra Fatima','amayra@gmail.com',NULL,NULL,'20/06/1993','K','L','female','unMarried','Dubai,UAE','Dubai,UAE','Software Engineer','Software Engineer','Java HTML CSS ','9999999999','9999999999','India','english','5','$2a$11$gwvsvUrFU.YirMM1Yb7NweFudLUM91AzH5BDFnhkNzfzpjG.FplYO'), +(10,'Aron','aron.DSilva@gmail.com',NULL,NULL,'27/01/2002','M nirban','R nirban','male','unMarried','Dubai,UAE','Dubai,UAE','Software Engineer','Software Engineer','Java HTML CSS ','7777777777','777777777','India','english','7','$2a$11$6oZEgfGGQAH23EaXLVZ2WOSKxcEJFnBSw2N2aghab0s2kcxSQwjhC'), +(11,'Kiran Kumar','kiran@gmail.com',NULL,NULL,'8/12/1993','K K','RK','male','unMarried','SanFrancisco','James Street','Software Engineer','Software Engineer','Java HTML CSS ','1010101010','1010101010','India','english','10','$2a$11$EXwpna1MlFFlKW5ut1iVi.AoeIulkPPmcOHFO8pOoQt1IYU9COU0m'), +(12,'Balbir Singh','balbir@gmail.com',NULL,NULL,'20/06/1993','balbir RK','balbir AK','male','unMarried','SanFrancisco','US','Software Engineer','Software Engineer','Java HTML CSS AWS','8888888111','8888888111','India','english','8','$2a$11$pzWNzzR.HUkHzz2zhAgqOeCl0WaTgY33NxxJ7n0l.rnEqjB9JO7vy'), +(4,'Hibo Prince','hibo.prince@gmail.com',NULL,NULL,'6/09/2000','Abara','Queen','male','unMarried','Electronic City,UAE','Electronic City,UAE','Tester','Freelancing','Python PHP ','9146389863','9146389871','Indian','hindi','3 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6JAR'), +(5,'Aejaaz Habeeb','aejaaz.habeeb@gmail.com',NULL,NULL,'16/02/2001','Imran','Ziya','male','unMarried','AbuDhabi,UAE','AbuDhabi,UAE','Developer','Developer','Azure Devops ','9566489863','9566489863','Indian','hindi','4 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6JAR'), +(6,'Jackie','jackie.chan@gmail.com',NULL,NULL,'28/09/1992','Charles','Chan','male','Married','HongKong,China','HongKong,China','MartialArtist','MartialArtist','KungFu ','9246488863','9246488863','Chinese','Mandrian','1 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6RAR'), +(13,'Srinath Goud','sgoud@gmail.com',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'$2a$11$6BSmYPrT8I8b9yHmx.uTRu/QxnQM2vhZYQa8mR33aReWA4WFihyGK'); + + +/*!40000 ALTER TABLE `user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `user_role` +-- + +DROP TABLE IF EXISTS `user_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user_role` ( + `user_id` int(11) NOT NULL, + `role_id` int(11) NOT NULL, + PRIMARY KEY (`user_id`,`role_id`), + KEY `fk_user_role_roleid_idx` (`role_id`), + CONSTRAINT `fk_user_role_roleid` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `fk_user_role_userid` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `user_role` +-- + +LOCK TABLES `user_role` WRITE; +/*!40000 ALTER TABLE `user_role` DISABLE KEYS */; +INSERT INTO `user_role` VALUES (4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1),(11,1),(12,1),(13,1); +/*!40000 ALTER TABLE `user_role` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2023-21-06 05:49:31 diff --git a/Docker-files/web/Dockerfile b/Docker-files/web/Dockerfile new file mode 100644 index 000000000..99d468509 --- /dev/null +++ b/Docker-files/web/Dockerfile @@ -0,0 +1,6 @@ +FROM nginx +LABEL "Project"="Vprofile" +LABEL "Author"="Imran" + +RUN rm -rf /etc/nginx/conf.d/default.conf +COPY nginvproapp.conf /etc/nginx/conf.d/vproapp.conf \ No newline at end of file diff --git a/Docker-files/web/nginvproapp.conf b/Docker-files/web/nginvproapp.conf new file mode 100644 index 000000000..ab3a503e4 --- /dev/null +++ b/Docker-files/web/nginvproapp.conf @@ -0,0 +1,9 @@ +upstream vproapp { + server vproapp:8080; +} +server { + listen 80; +location / { + proxy_pass http://vproapp; +} +} \ No newline at end of file diff --git a/Jenkinsfile b/ProdPipeline/Jenkinsfile similarity index 100% rename from Jenkinsfile rename to ProdPipeline/Jenkinsfile diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile new file mode 100644 index 000000000..d7b3f9079 --- /dev/null +++ b/StagePipeline/Jenkinsfile @@ -0,0 +1,128 @@ + +def COLOR_MAP = [ + 'SUCCESS': 'good', + 'FAILURE': 'danger', +] + +pipeline { + agent any + tools { + maven "Maven3.9" + jdk "JDK21" + } + + environment { + SNAP_REPO = 'vprofile-snapshot' + NEXUS_USER = 'admin' + NEXUS_PASS = 'Myworld@1997@' + RELEASE_REPO = 'vprofile-release' + CENTRAL_REPO = 'vpro-maven-central' + NEXUSIP = '172.31.6.37' + NEXUSPORT = '8081' + NEXUS_GRP_REPO = 'vpro-maven-group' + NEXUS_LOGIN = 'Nexuslogin' + SONARSERVER = 'sonarserver' + SONARSCANNER = 'sonarscanner' + + } + + stages { + stage('Build'){ + steps { + sh 'mvn -s settings.xml -DskipTests install' + + } + post { + success { + + echo "Now Archiving." + archiveArtifacts artifacts: '**/*.war' + } + + } + } + stage('Test'){ + steps { + + sh 'mvn -s settings.xml test' + echo "Testing1" + + } + + } + stage('Checkstyle Analysis'){ + + steps { + + sh 'mvn -s settings.xml checkstyle:checkstyle' + + + } + } + stage('Sonar Analysis'){ + tools { + jdk "JDK11" + } + + environment { + scannerHome = tool "${SONARSCANNER}" + } + + steps{ + + withSonarQubeEnv("${SONARSERVER}") { + sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ + -Dsonar.projectName=vprofile1 \ + -Dsonar.projectVersion=1.0 \ + -Dsonar.sources=src/ \ + -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ + -Dsonar.junit.reportsPath=target/surefire-reports/ \ + -Dsonar.jacoco.reportsPath=target/jacoco.exec \ + -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' + } + } + } + stage('Quality Gate'){ + steps{ + timeout(time: 1, unit: 'HOURS') { + // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails + // true = set pipeline to UNSTABLE, false = don't + waitForQualityGate abortPipeline: true + echo "wauting1" + } + } + } + stage('UploadArtifact"'){ + steps{ + nexusArtifactUploader( + nexusVersion: 'nexus3', + protocol: 'http', + nexusUrl: "${NEXUSIP}:${NEXUSPORT}", + groupId: 'QA', + version: "${env.BUILD_ID}-${env.BUILD_TIMESTAMP}", + repository: "${RELEASE_REPO}", + credentialsId: "${NEXUS_LOGIN}", + artifacts: [ + [artifactId: 'vproapp', + classifier: '', + file: 'target/vprofile-v2.war', + type: 'war'] + ] + ) + } + } + + } + post { + always { + echo 'Slack Notifications.' + slackSend channel: '#jenkinscicd', + color: COLOR_MAP[currentBuild.currentResult], + message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info at: ${env.BUILD_URL}" + + + } + } + + +} \ No newline at end of file From e792c1f40375767472d00ca54746534e10388e82 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 15:44:06 +0000 Subject: [PATCH 48/64] update --- StagePipeline/Jenkinsfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile index d7b3f9079..433f41891 100644 --- a/StagePipeline/Jenkinsfile +++ b/StagePipeline/Jenkinsfile @@ -23,6 +23,9 @@ pipeline { NEXUS_LOGIN = 'Nexuslogin' SONARSERVER = 'sonarserver' SONARSCANNER = 'sonarscanner' + registryCredential = 'ecr:us-west-1:awscreds' + appRegistry = '810351934067.dkr.ecr.us-west-1.amazonaws.com/vprofileapp' + vprofileRegistry = "https://810351934067.dkr.ecr.us-west-1.amazonaws.com" } @@ -111,6 +114,23 @@ pipeline { ) } } + stage('Build App Image') { + steps { + script { + dockerImage = docker.build( appRegistry + ":$BUILD_NUMBER", "./Docker-files/app/multistage/") + } + } + } + stage('Upload App Image') { + steps{ + script { + docker.withRegistry( vprofileRegistry, registryCredential ) { + dockerImage.push("$BUILD_NUMBER") + dockerImage.push('latest') + } + } + } + } } post { From 57e679f6f44af2cbb9abccf6da7e8beb51227833 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 15:54:03 +0000 Subject: [PATCH 49/64] yes --- Docker-files/app/multistage/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Docker-files/app/multistage/Dockerfile b/Docker-files/app/multistage/Dockerfile index c1b3ec3be..555a2ea5f 100644 --- a/Docker-files/app/multistage/Dockerfile +++ b/Docker-files/app/multistage/Dockerfile @@ -10,3 +10,5 @@ COPY --from=BUILD_IMAGE vprofile-project/target/vprofile-v2.war /usr/local/tomca EXPOSE 8080 CMD ["catalina.sh", "run"] + +# From e66e7a45add575fc34ed6b612806f0dc293b4ff1 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 15:58:16 +0000 Subject: [PATCH 50/64] yes --- Docker-files/app/multistage/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Docker-files/app/multistage/Dockerfile b/Docker-files/app/multistage/Dockerfile index 555a2ea5f..74ef3fee4 100644 --- a/Docker-files/app/multistage/Dockerfile +++ b/Docker-files/app/multistage/Dockerfile @@ -11,4 +11,3 @@ COPY --from=BUILD_IMAGE vprofile-project/target/vprofile-v2.war /usr/local/tomca EXPOSE 8080 CMD ["catalina.sh", "run"] -# From 9fe64a633f53e5fb10d31465c0ae1267573ec5de Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 16:03:11 +0000 Subject: [PATCH 51/64] yes --- StagePipeline/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile index 433f41891..107fb4b67 100644 --- a/StagePipeline/Jenkinsfile +++ b/StagePipeline/Jenkinsfile @@ -125,8 +125,10 @@ pipeline { steps{ script { docker.withRegistry( vprofileRegistry, registryCredential ) { + dockerImage.push("$JOB_NAME") dockerImage.push("$BUILD_NUMBER") dockerImage.push('latest') + } } } From 3a5d8843e014729a2abaae978692dd8436bf8073 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 16:05:11 +0000 Subject: [PATCH 52/64] c --- StagePipeline/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile index 107fb4b67..cca5b0615 100644 --- a/StagePipeline/Jenkinsfile +++ b/StagePipeline/Jenkinsfile @@ -124,8 +124,7 @@ pipeline { stage('Upload App Image') { steps{ script { - docker.withRegistry( vprofileRegistry, registryCredential ) { - dockerImage.push("$JOB_NAME") + docker.withRegistry( vprofileRegistry, registryCredential ) dockerImage.push("$BUILD_NUMBER") dockerImage.push('latest') From 720ec22fcbcc9e946318a840cd5487985a3b98b8 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 16:09:53 +0000 Subject: [PATCH 53/64] ce --- StagePipeline/Jenkinsfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile index cca5b0615..45b78380b 100644 --- a/StagePipeline/Jenkinsfile +++ b/StagePipeline/Jenkinsfile @@ -1,4 +1,3 @@ - def COLOR_MAP = [ 'SUCCESS': 'good', 'FAILURE': 'danger', @@ -124,14 +123,14 @@ pipeline { stage('Upload App Image') { steps{ script { - docker.withRegistry( vprofileRegistry, registryCredential ) + docker.withRegistry( vprofileRegistry, registryCredential ) dockerImage.push("$BUILD_NUMBER") dockerImage.push('latest') } } - } - } + } + } post { From d17c927884346204d09fbf3cea52d7f0a8b5bb0e Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 16:11:56 +0000 Subject: [PATCH 54/64] re-updated --- StagePipeline/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile index 45b78380b..a289385af 100644 --- a/StagePipeline/Jenkinsfile +++ b/StagePipeline/Jenkinsfile @@ -123,12 +123,12 @@ pipeline { stage('Upload App Image') { steps{ script { - docker.withRegistry( vprofileRegistry, registryCredential ) + docker.withRegistry( vprofileRegistry, registryCredential ) { dockerImage.push("$BUILD_NUMBER") dockerImage.push('latest') - } } + } } From 00de3d3800e5d9d2a4475abe9e8791c106e956a7 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 16:35:46 +0000 Subject: [PATCH 55/64] Deploy to ECS staging --- StagePipeline/Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile index a289385af..756d08b5c 100644 --- a/StagePipeline/Jenkinsfile +++ b/StagePipeline/Jenkinsfile @@ -130,6 +130,13 @@ pipeline { } } } + stage('Deploy to ECS staging') { + steps { + withAWS(credentials: 'awscreds', region: 'us-west-1') { + sh 'aws ecs update-service --cluster ${cluster} --service ${service} --force-new-deployment' + } + } + } } From 1ecdcc882675385df3d43a0c81f0776b8a3853a0 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 16:40:07 +0000 Subject: [PATCH 56/64] cluster --- StagePipeline/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile index 756d08b5c..1c31c7ce2 100644 --- a/StagePipeline/Jenkinsfile +++ b/StagePipeline/Jenkinsfile @@ -25,6 +25,8 @@ pipeline { registryCredential = 'ecr:us-west-1:awscreds' appRegistry = '810351934067.dkr.ecr.us-west-1.amazonaws.com/vprofileapp' vprofileRegistry = "https://810351934067.dkr.ecr.us-west-1.amazonaws.com" + cluster = "vprostagingnow" + service = "vproappstagetask-service-0vgrwkos" } From 56fe94cfb2286511542ce40f846fa3928911a895 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 17:01:12 +0000 Subject: [PATCH 57/64] oh --- ProdPipeline/Jenkinsfile | 118 ++++----------------------------------- 1 file changed, 11 insertions(+), 107 deletions(-) diff --git a/ProdPipeline/Jenkinsfile b/ProdPipeline/Jenkinsfile index d7b3f9079..3205aa828 100644 --- a/ProdPipeline/Jenkinsfile +++ b/ProdPipeline/Jenkinsfile @@ -1,116 +1,24 @@ - def COLOR_MAP = [ - 'SUCCESS': 'good', + 'SUCCESS': 'good', 'FAILURE': 'danger', ] pipeline { agent any - tools { - maven "Maven3.9" - jdk "JDK21" - } - + environment { - SNAP_REPO = 'vprofile-snapshot' - NEXUS_USER = 'admin' - NEXUS_PASS = 'Myworld@1997@' - RELEASE_REPO = 'vprofile-release' - CENTRAL_REPO = 'vpro-maven-central' - NEXUSIP = '172.31.6.37' - NEXUSPORT = '8081' - NEXUS_GRP_REPO = 'vpro-maven-group' - NEXUS_LOGIN = 'Nexuslogin' - SONARSERVER = 'sonarserver' - SONARSCANNER = 'sonarscanner' - + cluster = "vprofilelive" + service = "vprofile-live-service-ddrygy2s" } stages { - stage('Build'){ - steps { - sh 'mvn -s settings.xml -DskipTests install' - - } - post { - success { - - echo "Now Archiving." - archiveArtifacts artifacts: '**/*.war' - } - - } - } - stage('Test'){ - steps { - - sh 'mvn -s settings.xml test' - echo "Testing1" - - } - - } - stage('Checkstyle Analysis'){ - - steps { - - sh 'mvn -s settings.xml checkstyle:checkstyle' - - - } - } - stage('Sonar Analysis'){ - tools { - jdk "JDK11" - } - - environment { - scannerHome = tool "${SONARSCANNER}" - } - - steps{ - - withSonarQubeEnv("${SONARSERVER}") { - sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ - -Dsonar.projectName=vprofile1 \ - -Dsonar.projectVersion=1.0 \ - -Dsonar.sources=src/ \ - -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ - -Dsonar.junit.reportsPath=target/surefire-reports/ \ - -Dsonar.jacoco.reportsPath=target/jacoco.exec \ - -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' - } - } - } - stage('Quality Gate'){ - steps{ - timeout(time: 1, unit: 'HOURS') { - // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails - // true = set pipeline to UNSTABLE, false = don't - waitForQualityGate abortPipeline: true - echo "wauting1" - } - } - } - stage('UploadArtifact"'){ - steps{ - nexusArtifactUploader( - nexusVersion: 'nexus3', - protocol: 'http', - nexusUrl: "${NEXUSIP}:${NEXUSPORT}", - groupId: 'QA', - version: "${env.BUILD_ID}-${env.BUILD_TIMESTAMP}", - repository: "${RELEASE_REPO}", - credentialsId: "${NEXUS_LOGIN}", - artifacts: [ - [artifactId: 'vproapp', - classifier: '', - file: 'target/vprofile-v2.war', - type: 'war'] - ] - ) - } + stage('Deploy to Prod ecs') { + steps { + withAWS(credentials: 'awscreds', region: 'us-west-1') { + sh 'aws ecs update-service --cluster ${cluster} --service ${service} --force-new-deployment' } + } + } } post { @@ -118,11 +26,7 @@ pipeline { echo 'Slack Notifications.' slackSend channel: '#jenkinscicd', color: COLOR_MAP[currentBuild.currentResult], - message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info at: ${env.BUILD_URL}" - - + message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info available at: ${env.BUILD_URL}" } } - - } \ No newline at end of file From cf622f37bcfc098b5b0332c90ef6356746ba4cc3 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 17:02:57 +0000 Subject: [PATCH 58/64] test --- Docker-files/db/db_backup.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docker-files/db/db_backup.sql b/Docker-files/db/db_backup.sql index 2f17a4df3..48fcaca52 100644 --- a/Docker-files/db/db_backup.sql +++ b/Docker-files/db/db_backup.sql @@ -18,7 +18,7 @@ -- -- Table structure for table `role` -- - +# DROP TABLE IF EXISTS `role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; From 8833773fcc69ab9effd10301eb1bd073e049ecca Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 17:05:55 +0000 Subject: [PATCH 59/64] checkinglease enter the commit message for your changes. Lines starting --- Docker-files/db/db_backup.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docker-files/db/db_backup.sql b/Docker-files/db/db_backup.sql index 48fcaca52..2f17a4df3 100644 --- a/Docker-files/db/db_backup.sql +++ b/Docker-files/db/db_backup.sql @@ -18,7 +18,7 @@ -- -- Table structure for table `role` -- -# + DROP TABLE IF EXISTS `role`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; From ab4aef14939a3d51d18ac8280529b211f8f4087e Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 17:15:58 +0000 Subject: [PATCH 60/64] yes --- StagePipeline/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StagePipeline/Jenkinsfile b/StagePipeline/Jenkinsfile index 1c31c7ce2..faa00cc0c 100644 --- a/StagePipeline/Jenkinsfile +++ b/StagePipeline/Jenkinsfile @@ -96,7 +96,7 @@ pipeline { } } } - stage('UploadArtifact"'){ + stage('UplfoadArtifact"'){ steps{ nexusArtifactUploader( nexusVersion: 'nexus3', From 89c3f183439364ad572e474115c26c8d5a1bc5a0 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 17:44:00 +0000 Subject: [PATCH 61/64] Live --- ProdPipeline/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProdPipeline/Jenkinsfile b/ProdPipeline/Jenkinsfile index 3205aa828..9f85a75ae 100644 --- a/ProdPipeline/Jenkinsfile +++ b/ProdPipeline/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { } post { always { - echo 'Slack Notifications.' + echo 'Slack Notificationss.' slackSend channel: '#jenkinscicd', color: COLOR_MAP[currentBuild.currentResult], message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info available at: ${env.BUILD_URL}" From f3661866a4fbcab7c52d8c52ea15cbe7fc02ce09 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 17:45:07 +0000 Subject: [PATCH 62/64] yes --- ProdPipeline/Jenkinsfile => Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ProdPipeline/Jenkinsfile => Jenkinsfile (94%) diff --git a/ProdPipeline/Jenkinsfile b/Jenkinsfile similarity index 94% rename from ProdPipeline/Jenkinsfile rename to Jenkinsfile index 9f85a75ae..3205aa828 100644 --- a/ProdPipeline/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { } post { always { - echo 'Slack Notificationss.' + echo 'Slack Notifications.' slackSend channel: '#jenkinscicd', color: COLOR_MAP[currentBuild.currentResult], message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info available at: ${env.BUILD_URL}" From 55aaa0e60b2c6f9e9fd1bf3f09c6ce771aa3bedd Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 18:27:18 +0000 Subject: [PATCH 63/64] yes --- Docker-files/db/db_backup.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docker-files/db/db_backup.sql b/Docker-files/db/db_backup.sql index 2f17a4df3..ec8e65ec1 100644 --- a/Docker-files/db/db_backup.sql +++ b/Docker-files/db/db_backup.sql @@ -14,7 +14,7 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - +# -- -- Table structure for table `role` -- From ffdbf65648f93b066700afd21449ffb09a47bbf6 Mon Sep 17 00:00:00 2001 From: ajithkumars3131 Date: Sun, 27 Apr 2025 18:31:10 +0000 Subject: [PATCH 64/64] yes --- Docker-files/db/db_backup.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docker-files/db/db_backup.sql b/Docker-files/db/db_backup.sql index ec8e65ec1..2f17a4df3 100644 --- a/Docker-files/db/db_backup.sql +++ b/Docker-files/db/db_backup.sql @@ -14,7 +14,7 @@ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -# + -- -- Table structure for table `role` --