Date: Thu, 25 Jul 2024 09:50:57 +0000
Subject: [PATCH 52/54] Update version to 1.2.2
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ba18960d..739d7060 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
in.ADQ-JAVA-APP
JAVA_APP
war
- 1.2.113
+ 1.2.2
Java Home myweb
http://maven.apache.org
From 8f7427158bcc1036b1da3a06ce5df8845c58fc6b Mon Sep 17 00:00:00 2001
From: Saravana <67310667+SaravanaNani@users.noreply.github.com>
Date: Thu, 8 Aug 2024 11:26:17 +0530
Subject: [PATCH 53/54] Update Jenkinsfile
---
Jenkinsfile | 39 +++++++++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 6a952219..bf78d1e7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,6 +20,7 @@ pipeline {
NEXUS_VERSION = 'nexus3'
NEXUS_PROTOCOL = 'http'
SSH_KEY_PATH = '/var/lib/jenkins/.ssh/id_rsa'
+ ADMIN_EMAIL = 'getadqdevops@gmail.com'
}
stages {
stage('Checkout') {
@@ -64,13 +65,12 @@ pipeline {
mv JAVA_APP-1.2.*.war JAVA_APP-1.2.${BUILD_NUMBER}
'''
nexusArtifactUploader artifacts: [[artifactId: "${NEXUS_ARTIFACT_ID}", classifier: '', file: "${WORKSPACE_DIR}/target/JAVA_APP-1.2.${BUILD_NUMBER}", type: 'war']], credentialsId: 'nexus_id', groupId: "${NEXUS_GROUP_ID}", nexusUrl: "${NEXUS_URL}", nexusVersion: "${NEXUS_VERSION}", protocol: "${NEXUS_PROTOCOL}", repository: "${NEXUS_REPOSITORY}", version: "1.2.${BUILD_NUMBER}"
- }
+ }
}
}
- stage('Confirmation') {
+ stage('Check Infrastructure and Request Approval') {
steps {
script {
- input message: 'Are you sure you want to proceed with the deployment?', ok: 'Yes'
def instanceStatus = sh(script: "gcloud compute instances describe ${INSTANCE_NAME} --project=${PROJECT_ID} --zone=${ZONE} --format='get(status)'", returnStdout: true).trim()
if (instanceStatus != 'RUNNING') {
error "VM instance is not running. Deployment stopped."
@@ -79,13 +79,44 @@ pipeline {
gcloud compute instances list --filter="labels.adq_ubuntudesktop=app" --format="value(networkInterfaces[0].networkIP)" --limit=1
''', returnStdout: true).trim()
echo "Private IP: ${env.PRIVATE_IP}"
+
+ emailext (
+ subject: "Approval Needed: Proceed with Deployment",
+ body: """
+ The infrastructure is ready for deployment.
+ Instance Status: ${instanceStatus}
+ Private IP: ${env.PRIVATE_IP}
+ Please approve the execution of the deployment stage.
+ Click here to provide approval.
+ """,
+ mimeType: 'text/html',
+ to: "${env.ADMIN_EMAIL}"
+ )
+ echo 'Approval email sent. Awaiting manual approval...'
+
+ def userInput = input(
+ id: 'userInput', message: 'Approval needed to proceed with the deployment.', parameters: [
+ [$class: 'BooleanParameterDefinition', defaultValue: true, description: 'Approve to proceed?', name: 'Proceed']
+ ]
+ )
+
+ if (!userInput) {
+ echo 'Aborted by user.'
+ currentBuild.result = 'ABORTED'
+ emailext (
+ subject: "Approval Denied: Deployment",
+ body: "The stage to deploy has been denied and will not be executed.",
+ mimeType: 'text/html',
+ to: "${env.ADMIN_EMAIL}"
+ )
+ error('User aborted the stage.')
+ }
}
}
}
stage('Deployment') {
steps {
script {
- // Use Jenkins credentials to authenticate with Nexus
withCredentials([usernamePassword(credentialsId: 'nexus_id', usernameVariable: 'NEXUS_USER', passwordVariable: 'NEXUS_PASSWORD')]) {
sh '''
# Clear the target directory
From bbc9dd9d558d0217d136c94a2bb17984b123381e Mon Sep 17 00:00:00 2001
From: Saravana <67310667+SaravanaNani@users.noreply.github.com>
Date: Thu, 8 Aug 2024 11:33:03 +0530
Subject: [PATCH 54/54] Update Jenkinsfile
---
Jenkinsfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index bf78d1e7..75ac6b94 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -10,7 +10,7 @@ pipeline {
PROJECT_ID = 'gcp-adq-pocproject-dev'
ZONE = 'us-central1-c'
INSTANCE_NAME = 'get-ubuntudesktop'
- TARGET_HOST_PATH = '/opt/tomcat/apache-tomcat-10.1.26'
+ TARGET_HOST_PATH = '/opt/tomcat/apache-tomcat-10.1.28'
SONARQUBE_PROJECT_KEY = 'adq-java-app'
SONARQUBE_HOST_URL = 'http://34.69.178.242:9000'
NEXUS_URL = '34.69.178.242:8081'