From b8508d3de246cbfca81678d64850c78d9e5fd76d Mon Sep 17 00:00:00 2001
From: pchinthapenta <127722176+pchinthapenta@users.noreply.github.com>
Date: Tue, 26 Mar 2024 17:55:32 +0530
Subject: [PATCH] chore: Updated java-maven deploy config (#1060)
---
test/deploy/linux/java/javaApp/pom.xml | 5 +++--
.../linux/java/redhat/roles/configure/tasks/main.yml | 12 +++++++-----
.../apm/java/linux/java-tomcat-maven-linux2.json | 6 +++---
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/test/deploy/linux/java/javaApp/pom.xml b/test/deploy/linux/java/javaApp/pom.xml
index 257a4b29..fa6ac095 100644
--- a/test/deploy/linux/java/javaApp/pom.xml
+++ b/test/deploy/linux/java/javaApp/pom.xml
@@ -13,12 +13,13 @@
junit
3.8.1
test
-
+
+
javaApp
-
+
org.codehaus.mojo
exec-maven-plugin
diff --git a/test/deploy/linux/java/redhat/roles/configure/tasks/main.yml b/test/deploy/linux/java/redhat/roles/configure/tasks/main.yml
index a9a44e0c..0ad7c6a9 100644
--- a/test/deploy/linux/java/redhat/roles/configure/tasks/main.yml
+++ b/test/deploy/linux/java/redhat/roles/configure/tasks/main.yml
@@ -17,6 +17,13 @@
shell: chmod -R 777 /opt/tomcat/latest/bin
become: true
+- name: Change the permissions and ownership of javaApp & tomcat directories
+ shell: chown -R ec2-user:ec2-user /home/ec2-user/javaApp/ &&
+ chmod -R 755 /home/ec2-user/javaApp &&
+ chown -R ec2-user:ec2-user /opt/tomcat/ &&
+ chmod -R 755 /opt/tomcat/
+ become: true
+
- name: Build Java App with Maven
ansible.builtin.command:
cmd: mvn clean package -f /home/ec2-user/javaApp/pom.xml
@@ -25,11 +32,6 @@
PATH: "{{ ansible_env.PATH }}:/opt/jdk-14.0.1/bin:/opt/apache-maven/bin"
JRE_HOME: "/opt/jdk-14.0.1"
become: true
-
-- name: Change the permissions and ownership of javaApp directory
- shell: chown -R ec2-user:ec2-user /home/ec2-user/javaApp/ &&
- chmod -R 755 /home/ec2-user/javaApp
- become: true
- name: Move the package
shell: mv /home/ec2-user/javaApp/target/javaApp.war /opt/tomcat/latest/webapps
diff --git a/test/manual/definitions/apm/java/linux/java-tomcat-maven-linux2.json b/test/manual/definitions/apm/java/linux/java-tomcat-maven-linux2.json
index baffab15..a7320fd5 100644
--- a/test/manual/definitions/apm/java/linux/java-tomcat-maven-linux2.json
+++ b/test/manual/definitions/apm/java/linux/java-tomcat-maven-linux2.json
@@ -7,7 +7,7 @@
},
"resources": [
{
- "id": "dummyApp",
+ "id": "java-mav-tom-testapp",
"provider": "aws",
"type": "ec2",
"size": "t3.small",
@@ -20,14 +20,14 @@
"source_repository": "https://github.com/newrelic/open-install-library.git",
"deploy_script_path": "test/deploy/linux/tomcat/systemd/shScript/catalina/install/linux/roles",
"port": 6001,
- "destinations": ["dummyApp"]
+ "destinations": ["java-mav-tom-testapp"]
},
{
"id": "javaApp",
"source_repository": "https://github.com/newrelic/open-install-library.git",
"deploy_script_path": "test/deploy/linux/java/redhat/roles",
"port": 80,
- "destinations": ["dummyApp"]
+ "destinations": ["java-mav-tom-testapp"]
}
]
}